content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
from trac.test import EnvironmentStub from trac.ticket.roadmap import * from trac.core import ComponentManager import unittest if __name__ == '__main__': unittest.main(defaultTest='suite')
[ 6738, 491, 330, 13, 9288, 1330, 9344, 1273, 549, 201, 198, 6738, 491, 330, 13, 43350, 13, 6344, 8899, 1330, 1635, 201, 198, 6738, 491, 330, 13, 7295, 1330, 35100, 13511, 201, 198, 201, 198, 11748, 555, 715, 395, 201, 198, 201, 198, ...
2.723684
76
import pandas as pd import numpy as np #sample code ONES = pd.DataFrame(np) ZEROES = pd.DataFrame(np.zeros(50)) #sample functions
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 628, 198, 2, 39873, 2438, 198, 39677, 796, 279, 67, 13, 6601, 19778, 7, 37659, 8, 198, 57, 34812, 1546, 796, 279, 67, 13, 6601, 19778, 7, 37659, 13, 9107, 418, 7...
2.607843
51
"""Config flow to configure the Luxtronik heatpump controller integration.""" # region Imports from __future__ import annotations from typing import Any import homeassistant.helpers.config_validation as cv import voluptuous as vol from homeassistant import config_entries from homeassistant.components.dhcp import HOST...
[ 37811, 16934, 5202, 284, 17425, 262, 6026, 742, 1313, 1134, 4894, 79, 931, 10444, 11812, 526, 15931, 198, 2, 3814, 1846, 3742, 198, 6738, 11593, 37443, 834, 1330, 37647, 198, 198, 6738, 19720, 1330, 4377, 198, 198, 11748, 1363, 562, 101...
2.121983
2,320
from django.conf import settings if 'django_select2' in settings.INSTALLED_APPS: try: from django_select2.fields import AutoModelSelect2Field except ImportError: pass
[ 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 361, 705, 28241, 14208, 62, 19738, 17, 6, 287, 6460, 13, 38604, 7036, 1961, 62, 2969, 3705, 25, 198, 220, 220, 220, 1949, 25, 628, 220, 220, 220, 220, 220, 220, 220, 422, 42625, 14208,...
2.694444
72
import torch from torch import nn if __name__=="__main__": #test net_encoder = encoder_extract(dim_bottleneck=64*64*3, ch=64).cuda() net_decoder = decoder_extract(dim_bottleneck=64*64*3, ch=64).cuda() net_encoder = nn.DataParallel(net_encoder) net_decoder = nn.DataParallel(net_decoder) x...
[ 11748, 28034, 198, 6738, 28034, 1330, 299, 77, 628, 628, 628, 198, 361, 11593, 3672, 834, 855, 1, 834, 12417, 834, 1298, 198, 220, 220, 220, 1303, 9288, 628, 220, 220, 220, 2010, 62, 12685, 12342, 796, 2207, 12342, 62, 2302, 974, 7,...
2.122172
221
import ctypes import msvcrt import os import sys import code import windows from .. import winproxy from ..generated_def import windef from ..generated_def.winstructs import * # Function resolution ! def create_file_from_handle(handle, mode="r"): """Return a Python :class:`file` arround a windows HANDLE""" ...
[ 11748, 269, 19199, 198, 11748, 13845, 85, 6098, 83, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 2438, 198, 198, 11748, 9168, 198, 6738, 11485, 1330, 1592, 36436, 198, 6738, 11485, 27568, 62, 4299, 1330, 2344, 891, 198, 6738, 11485, ...
2.565333
1,500
import os import shutil import subprocess import sys def run(*args, env: dict = None, check=True): """Runs command and exits script gracefully on errors.""" print(f'+ {" ".join(args)}') if env is None: env = os.environ else: env = {**env, **os.environ} result = subprocess.run(ar...
[ 11748, 28686, 198, 11748, 4423, 346, 198, 11748, 850, 14681, 198, 11748, 25064, 628, 198, 4299, 1057, 46491, 22046, 11, 17365, 25, 8633, 796, 6045, 11, 2198, 28, 17821, 2599, 198, 220, 220, 220, 37227, 10987, 82, 3141, 290, 30151, 4226,...
2.432886
596
""" Investment adviser module """ import os import json import config from model.bank_account import get_next_investment_account _INVEST_FILE = "invest.json" class InvestmentAdviser: """ Investment adviser class """ def advise(self, amount: float) -> []: """ Advise investment """ result = []...
[ 37811, 20877, 12534, 8265, 37227, 198, 11748, 28686, 198, 11748, 33918, 198, 11748, 4566, 198, 6738, 2746, 13, 17796, 62, 23317, 1330, 651, 62, 19545, 62, 24859, 434, 62, 23317, 198, 198, 62, 1268, 53, 6465, 62, 25664, 796, 366, 24859, ...
2.179775
534
import numpy as np import matplotlib.pyplot as plt import time
[ 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 640 ]
3.263158
19
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from goodtables.checks.blank_header import blank_header import goodtables.cells # Check
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 11593, 37443, 834, 1330, 7297, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 6738, 11593, 37443, 834,...
3.441558
77
import numpy as np import pandas as pd d1 = { 'c1':[1,2,3,4], 'c2':[444,555,666,444], 'c3':'abc def hij lmn'.split()} d2 = { 'c1':[1,2,3], 'c4':'x y z'.split() } print (d1) df1 = pd.DataFrame(d1) print (df1) print(df1['c2'].unique()) df2 = pd.DataFrame(d2) print (pd.merge(df1,df2,how="inner",on='c1')) print (df1[...
[ 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 198, 67, 16, 796, 1391, 198, 6, 66, 16, 10354, 58, 16, 11, 17, 11, 18, 11, 19, 4357, 198, 6, 66, 17, 10354, 58, 30272, 11, 31046, 11, 27310, 11, 30272, ...
1.867347
196
__version__ = '36.1.0'
[ 834, 9641, 834, 796, 705, 2623, 13, 16, 13, 15, 6, 198 ]
1.916667
12
# -*- coding: utf-8 -*- ''' for database schema migration. Memo for Usage: migrate.migrate(torcms_migrator.rename_table('e_layout', 'mablayout')) migrate.migrate(torcms_migrator.drop_column('tabtag', 'role_mask')) ''' from playhouse import migrate from playhouse.postgres_ext import BinaryJSONField import conf...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 7061, 6, 198, 1640, 6831, 32815, 13472, 13, 198, 198, 13579, 78, 329, 29566, 25, 198, 220, 220, 220, 32492, 13, 76, 42175, 7, 13165, 46406, 62, 76, 3692, 1352, ...
2.574257
303
from asyncorm.apps.app_config import AppConfig
[ 6738, 30351, 579, 13, 18211, 13, 1324, 62, 11250, 1330, 2034, 16934, 628 ]
3.692308
13
import ast import itertools import textwrap from pytype import config from pytype.tests import test_base from pytype.tools.annotate_ast import annotate_ast import six test_base.main(globals(), __name__ == '__main__')
[ 11748, 6468, 198, 11748, 340, 861, 10141, 198, 11748, 2420, 37150, 198, 198, 6738, 12972, 4906, 1330, 4566, 198, 6738, 12972, 4906, 13, 41989, 1330, 1332, 62, 8692, 198, 6738, 12972, 4906, 13, 31391, 13, 34574, 378, 62, 459, 1330, 24708...
3.157143
70
from sqlalchemy.orm.session import make_transient, make_transient_to_detached from app.utils.settings import app_config from flask_allows import Not, Permission from app.utils.requirements import IsAdmin from flask_jwt_extended import current_user from app.user.models import User, Group from ..schemas import UsersSchem...
[ 6738, 44161, 282, 26599, 13, 579, 13, 29891, 1330, 787, 62, 7645, 1153, 11, 787, 62, 7645, 1153, 62, 1462, 62, 15255, 2317, 198, 6738, 598, 13, 26791, 13, 33692, 1330, 598, 62, 11250, 198, 6738, 42903, 62, 47205, 1330, 1892, 11, 244...
3.596774
124
import dash import dash_core_components as dcc import dash_html_components as html # object Dash app app = dash.Dash() app.layout = html.Div([ # Div untuk Dropdown html.Div([ html.Label(["Length Unit"]), dcc.Dropdown(id='my-dropdown', options=[{'label':'cm', 'value': 'centimeter'}, {'label':'m',...
[ 11748, 14470, 198, 11748, 14470, 62, 7295, 62, 5589, 3906, 355, 288, 535, 220, 198, 11748, 14470, 62, 6494, 62, 5589, 3906, 355, 27711, 198, 198, 2, 2134, 16189, 598, 198, 1324, 796, 14470, 13, 43041, 3419, 220, 198, 198, 1324, 13, ...
2.224252
602
# coding: UTF-8 ''' Created on Nov 13, 2018 @author: Yusuke_Tokugawa ''' import dataclasses from typing import List @dataclasses.dataclass
[ 2, 19617, 25, 41002, 12, 23, 198, 7061, 6, 198, 41972, 319, 5267, 1511, 11, 2864, 198, 198, 31, 9800, 25, 41749, 4649, 62, 19042, 1018, 6909, 198, 7061, 6, 198, 11748, 4818, 330, 28958, 198, 6738, 19720, 1330, 7343, 198, 198, 31, ...
2.8
50
# -*- encoding: utf-8 -*- #Written by: Karim shoair - D4Vinci ( Cr3dOv3r ) import os,time,subprocess,pkg_resources from . import updater from .color import * banner = """{G} /T /I / |/ | .-~/ T\ Y I |/ / _ /T ...
[ 2, 532, 9, 12, 21004, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 25354, 416, 25, 9375, 320, 7354, 958, 532, 360, 19, 53, 259, 979, 357, 3864, 18, 67, 46, 85, 18, 81, 1267, 198, 11748, 28686, 11, 2435, 11, 7266, 14681, 11, 353...
1.436447
1,959
import numpy as np from ..feat_selectors import FeatureSelector
[ 11748, 299, 32152, 355, 45941, 198, 6738, 11485, 27594, 62, 19738, 669, 1330, 27018, 17563, 273, 628 ]
3.823529
17
import os import csv import codecs import yaml import time import numpy as np import nltk from nltk.translate import bleu_score import pickle import gzip def read_config(path): '''读取config文件''' return AttrDict(yaml.load(open(path, 'r')))
[ 11748, 28686, 201, 198, 11748, 269, 21370, 201, 198, 11748, 40481, 82, 201, 198, 11748, 331, 43695, 201, 198, 11748, 640, 201, 198, 11748, 299, 32152, 355, 45941, 201, 198, 11748, 299, 2528, 74, 201, 198, 6738, 299, 2528, 74, 13, 7645...
2.049645
141
# -*- coding: utf-8 -*- """Add jinja-evaluated types to lektor. """ import jinja2 from lektor.environment import ( Expression, FormatExpression, ) from lektor.pluginsystem import Plugin from lektor.types import Type
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 4550, 474, 259, 6592, 12, 18206, 6605, 3858, 284, 443, 74, 13165, 13, 198, 37811, 198, 11748, 474, 259, 6592, 17, 198, 6738, 443, 74, 13165, 13, 38986, 1330, 35...
2.709302
86
''' Non-business-logic utility functions ''' def firsts(rows): ''' Returns the set of first elements of all rows: >>> sorted(firsts([(7, 1, 2),\ [5, 4, 0, 3],\ [8, 4],\ [5, 4]])) [5, 7, 8] ''' return set(r[0] for r in rows) def pack_by(l, n): ''' Yields element...
[ 7061, 6, 198, 15419, 12, 22680, 12, 6404, 291, 10361, 5499, 198, 7061, 6, 198, 198, 4299, 717, 82, 7, 8516, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 16409, 262, 900, 286, 717, 4847, 286, 477, 15274, 25, 628, 220, ...
2.005115
391
from stuff import * import json,os from requests import get import numpy as np from random import random from math import sqrt,log np.set_printoptions(precision=4,suppress=True) np.set_printoptions(edgeitems=30, linewidth=100000) adir='casesbyspecdate' mindate='2021-02-24'# Can't get archive data earlier than 2021-02...
[ 6738, 3404, 1330, 1635, 198, 11748, 33918, 11, 418, 198, 6738, 7007, 1330, 651, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 4738, 1330, 4738, 198, 6738, 10688, 1330, 19862, 17034, 11, 6404, 198, 198, 37659, 13, 2617, 62, 4798, 25811,...
2.301259
1,112
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 2, 770, 2438, 318, 636, 286, 1195, 1984, 270, 13, 198, 2, 198, 2, 357, 34, 8, 15069, 19764, 2177, 11, 33448, 13, 198, 2, 198, 2, 770, 2438, 318, 11971, 739, ...
2.099458
3,871
############################################################################### # The MIT License (MIT) # # Copyright (c) 2014 Justin Lovinger # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Softwar...
[ 29113, 29113, 7804, 4242, 21017, 198, 2, 383, 17168, 13789, 357, 36393, 8, 198, 2, 198, 2, 15069, 357, 66, 8, 1946, 10799, 39911, 3889, 198, 2, 198, 2, 2448, 3411, 318, 29376, 7520, 11, 1479, 286, 3877, 11, 284, 597, 1048, 16727, ...
3.586643
554
import csv import json from itertools import zip_longest with open('../energy_detectors/data/ros-discourse_data.json') as f: rosd_data = json.load(f) rosd_url = [item.get('url') for item in rosd_data] rosd_tcontents = [item.get('thread_contents') for item in rosd_data] rosd_tdetails = [item.get(...
[ 11748, 269, 21370, 198, 11748, 33918, 198, 6738, 340, 861, 10141, 1330, 19974, 62, 6511, 395, 198, 198, 4480, 1280, 10786, 40720, 22554, 62, 15255, 478, 669, 14, 7890, 14, 4951, 12, 15410, 9047, 62, 7890, 13, 17752, 11537, 355, 277, 2...
2.095627
1,715
import tensorflow as tf import numpy as np def mu_law(x, mu=255, int8=False): """A TF implementation of Mu-Law encoding. Args: x: The audio samples to encode between [-1, 1] mu: The Mu to use in our Mu-Law. int8: Use int8 encoding. Returns: out: The Mu-Law encoded int8 data [-128...
[ 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 299, 32152, 355, 45941, 628, 198, 4299, 38779, 62, 6270, 7, 87, 11, 38779, 28, 13381, 11, 493, 23, 28, 25101, 2599, 198, 220, 220, 220, 37227, 32, 24958, 7822, 286, 8252, 12, 16966, ...
2.337486
1,766
import unittest from TestUtils import TestParser
[ 11748, 555, 715, 395, 198, 6738, 6208, 18274, 4487, 1330, 6208, 46677, 198 ]
3.769231
13
#Faça um Programa que calcule a área de um quadrado, # em seguida mostre o dobro desta área para o usuário. from decimal import Decimal lado = Decimal(input("Informe o lado do quadrado:")) a = lado ** 2 print("O dobro da área do quadrado é",(a * 2))
[ 2, 50110, 50041, 23781, 6118, 64, 8358, 2386, 23172, 257, 6184, 94, 21468, 390, 23781, 15094, 81, 4533, 11, 198, 2, 795, 384, 5162, 3755, 749, 260, 267, 466, 7957, 2244, 64, 6184, 94, 21468, 31215, 267, 514, 84, 6557, 27250, 13, 220...
2.55102
98
#!/usr/bin/env python3 # IBM_PROLOG_BEGIN_TAG # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2022 # [+] International Business Machines Corp. # # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may o...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 19764, 62, 4805, 33462, 62, 33, 43312, 62, 42197, 198, 2, 4946, 47, 36048, 17406, 515, 6208, 4935, 198, 2, 198, 2, 25767, 669, 406, 6347, 10383, 532, 27975, 38162, 9947, 33160...
2.517617
1,192
import mido from pythonosc import udp_client import time oscip = "127.0.0.1" oscport = 31337 client = udp_client.SimpleUDPClient(oscip, oscport) # Read from midi #with mido.open_input() as inport: # while True: # for msg in inport: # client.send_message("/traktor/beat", msg.type) while True: ...
[ 11748, 3095, 78, 198, 6738, 21015, 17500, 1330, 334, 26059, 62, 16366, 198, 11748, 640, 628, 198, 17500, 541, 796, 366, 16799, 13, 15, 13, 15, 13, 16, 1, 198, 17500, 634, 796, 35897, 2718, 628, 198, 16366, 796, 334, 26059, 62, 16366...
2.347561
164
# GNU MediaGoblin -- federated, autonomous media hosting # Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either versio...
[ 2, 22961, 6343, 38, 672, 2815, 1377, 28062, 515, 11, 18284, 2056, 13662, 198, 2, 15069, 357, 34, 8, 2813, 11, 2321, 6343, 38, 672, 2815, 20420, 13, 220, 4091, 37195, 20673, 13, 198, 2, 198, 2, 770, 1430, 318, 1479, 3788, 25, 345, ...
2.372453
5,104
def round_channels(channels, multiplier=1.0, divisor=8, channel_min=None): """Round number of filters based on depth multiplier.""" if not multiplier: return channels channels *= multiplier return make_divisible(channels, divisor, channel_min)
[ 628, 198, 4299, 2835, 62, 354, 8961, 7, 354, 8961, 11, 33090, 28, 16, 13, 15, 11, 2659, 271, 273, 28, 23, 11, 6518, 62, 1084, 28, 14202, 2599, 198, 220, 220, 220, 37227, 22685, 1271, 286, 16628, 1912, 319, 6795, 33090, 526, 15931,...
2.956522
92
import unittest from module import webpage_get NORMAL_URL_LIST = ["http://www.baidu.com"] ABNORMAL_URL_LIST = ["aaa"] DEFAULT_TIMEOUT = 1
[ 11748, 555, 715, 395, 198, 6738, 8265, 1330, 35699, 62, 1136, 198, 198, 35510, 42126, 62, 21886, 62, 45849, 796, 14631, 4023, 1378, 2503, 13, 65, 1698, 84, 13, 785, 8973, 198, 6242, 35510, 42126, 62, 21886, 62, 45849, 796, 14631, 4607...
2.660377
53
# # Copyright (c) 2015 NORDUnet A/S # 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 ...
[ 2, 198, 2, 15069, 357, 66, 8, 1853, 399, 12532, 3118, 316, 317, 14, 50, 198, 2, 1439, 2489, 10395, 13, 198, 2, 198, 2, 220, 220, 2297, 396, 3890, 290, 779, 287, 2723, 290, 13934, 5107, 11, 351, 393, 198, 2, 220, 220, 1231, 176...
3.228769
577
import time from django.core.exceptions import ImproperlyConfigured from django.conf import settings from throttle.zones.remoteip import RemoteIP from throttle.exceptions import ThrottleZoneNotDefined, ThrottleImproperlyConfigured, RateLimitExceeded from throttle.utils import load_class_from_path, serialize_bucket_key...
[ 11748, 640, 198, 6738, 42625, 14208, 13, 7295, 13, 1069, 11755, 1330, 12205, 525, 306, 16934, 1522, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 198, 6738, 29976, 13, 89, 1952, 13, 47960, 541, 1330, 21520, 4061, 198, 6738, 29976...
3.28169
142
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Mingjun Zhou <mingjun.zhou@gmail.com> # Licence: BSD 3 clause import numpy as np def potvariables(pots): """Returns information about all variables in a set of potentials Return the variables and their number of states. If there is a dimension mi...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 2, 6434, 25, 26980, 29741, 32222, 1279, 2229, 29741, 13, 38536, 31, 14816, 13, 785, 29, 198, 2, 10483, 594, 25, ...
2.28446
1,139
""" -*- coding: utf-8 -*- Time : 2019/7/13 15:51 Author : Hansybx """ import re import requests from bs4 import BeautifulSoup from flask import jsonify from app.models.error import PasswordFailed from app.models.student_info import StudentInfo from app.utils.common_utils import put_to_mysql headers = { '...
[ 37811, 628, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 7575, 220, 220, 220, 1058, 13130, 14, 22, 14, 1485, 1315, 25, 4349, 198, 13838, 220, 1058, 13071, 88, 65, 87, 198, 198, 37811, 198, 198, 11748, 302, 198, 198,...
2.55
240
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2013-2016 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # from sqlalchemy import Column, MetaData, String, Table from sysinv.common import constants ENGINE = 'InnoDB' CHARSET = 'utf8'
[ 2, 43907, 25, 7400, 11338, 28, 19, 6482, 10394, 28, 19, 2705, 8658, 11338, 28, 19, 198, 2, 198, 2, 15069, 357, 66, 8, 2211, 12, 5304, 3086, 5866, 11998, 11, 3457, 13, 198, 2, 198, 2, 30628, 55, 12, 34156, 12, 33234, 7483, 25, ...
2.804124
97
# flake8: noqa from importlib_metadata import version # type: ignore from songpal.common import SongpalException from songpal.device import Device from songpal.notification import ( ConnectChange, ContentChange, Notification, PowerChange, VolumeChange, ) __version__ = version("python-songpal")
[ 2, 781, 539, 23, 25, 645, 20402, 198, 6738, 1330, 8019, 62, 38993, 1330, 2196, 220, 1303, 2099, 25, 8856, 198, 6738, 3496, 18596, 13, 11321, 1330, 10940, 18596, 16922, 198, 6738, 3496, 18596, 13, 25202, 1330, 16232, 198, 6738, 3496, 1...
3.268041
97
from gym.envs.registration import register from .wrappers import * from .logger import * from .envs import * register( id='BanditsX2-v0', kwargs = {'num_bandits' : 2}, entry_point='torch_rl.envs:BanditEnv', ) register( id='BanditsX4-v0', kwargs = {'num_bandits' : 4}, entry_point='torch_rl.env...
[ 6738, 11550, 13, 268, 14259, 13, 2301, 33397, 1330, 7881, 198, 6738, 764, 29988, 11799, 1330, 1635, 198, 6738, 764, 6404, 1362, 1330, 1635, 198, 6738, 764, 268, 14259, 1330, 1635, 198, 198, 30238, 7, 198, 220, 220, 220, 4686, 11639, 3...
2.069337
649
import dash_html_components as html import dash_core_components as dcc import dash_table as dt import pandas as pd heading_2 = html.Header( html.H2( "Classify Emails (Spam or Ham)", style={ "text-align": "center", "margin": "10px", "font-weight": "lighter", ...
[ 11748, 14470, 62, 6494, 62, 5589, 3906, 355, 27711, 198, 11748, 14470, 62, 7295, 62, 5589, 3906, 355, 288, 535, 198, 11748, 14470, 62, 11487, 355, 288, 83, 198, 11748, 19798, 292, 355, 279, 67, 628, 198, 33878, 62, 17, 796, 27711, 1...
2.096882
898
from PIL import Image import numpy as np label_colours = [(178, 45, 45), (153, 115, 115), (64, 36, 32), (255, 68, 0), (89, 24, 0), (191, 121, 96), (191, 102, 0), (76, 41, 0), (153, 115, 38), (102, 94, 77), (242, 194, 0), (191, 188, 143), (226, 242, 0), (119, 128, 0), (59, 64, 0), (10...
[ 6738, 350, 4146, 1330, 7412, 198, 11748, 299, 32152, 355, 45941, 628, 198, 18242, 62, 4033, 4662, 796, 47527, 23188, 11, 4153, 11, 4153, 828, 357, 21395, 11, 12279, 11, 12279, 828, 357, 2414, 11, 4570, 11, 3933, 828, 357, 13381, 11, ...
1.922374
438
import sys from fractions import * sys.stdin = open('input.txt') numTest = int(input()) for itertest in range(numTest): n = int(input()) print 'Case %d: %s' % (itertest + 1, Fraction(n * (n - 1), 4))
[ 11748, 25064, 198, 6738, 49876, 1330, 1635, 198, 198, 17597, 13, 19282, 259, 796, 1280, 10786, 15414, 13, 14116, 11537, 198, 22510, 14402, 796, 493, 7, 15414, 28955, 198, 1640, 340, 861, 395, 287, 2837, 7, 22510, 14402, 2599, 198, 220, ...
2.518072
83
# vim: set encoding=utf-8 # Copyright (c) 2016 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 require...
[ 2, 43907, 25, 900, 21004, 28, 40477, 12, 23, 198, 198, 2, 220, 15069, 1849, 7, 66, 8, 1849, 5304, 8180, 1849, 10606, 1819, 341, 1849, 198, 2, 198, 2, 220, 49962, 1849, 4625, 1849, 1169, 1849, 25189, 4891, 1849, 34156, 11, 1849, 14...
2.591331
323
from django.apps import AppConfig
[ 6738, 42625, 14208, 13, 18211, 1330, 2034, 16934, 628 ]
3.888889
9
import collections from typing import Callable import torch.nn as nn from ..modules import DropBlock class LinearDownsample(nn.Sequential): ''' Downsample class with linear mapping. This is a default donwsample mudule for ResNets. '''
[ 11748, 17268, 198, 6738, 19720, 1330, 4889, 540, 198, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 198, 6738, 11485, 18170, 1330, 14258, 12235, 628, 198, 4871, 44800, 8048, 39873, 7, 20471, 13, 44015, 1843, 2599, 198, 220, 220, 220,...
3.227848
79
Cellname="???rk" NodeName="???dea" #Que...
[ 28780, 3672, 2625, 28358, 81, 74, 1, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ...
1.113953
860
# This script is identical to the on for BFSongRepository but with canaries from collections import defaultdict import json from pathlib import Path import matplotlib.pyplot as plt import numpy as np import pandas as pd import torch from tqdm import tqdm import vak.device import vak.files from vak.labeled_timebins im...
[ 2, 770, 4226, 318, 10411, 284, 262, 319, 329, 347, 10652, 506, 6207, 13264, 475, 351, 460, 3166, 198, 6738, 17268, 1330, 4277, 11600, 198, 11748, 33918, 198, 6738, 3108, 8019, 1330, 10644, 198, 198, 11748, 2603, 29487, 8019, 13, 9078, ...
1.829617
6,996
import json from test_plus.test import TestCase from instanotifier.feedsource.models import FeedSource from instanotifier.feedsource.forms import FeedSourceForm
[ 11748, 33918, 198, 198, 6738, 1332, 62, 9541, 13, 9288, 1330, 6208, 20448, 198, 198, 6738, 916, 272, 313, 7483, 13, 12363, 10459, 13, 27530, 1330, 18272, 7416, 198, 6738, 916, 272, 313, 7483, 13, 12363, 10459, 13, 23914, 1330, 18272, ...
3.727273
44
import pytest from temperature import celsius_to_fahrenheit
[ 11748, 12972, 9288, 198, 6738, 5951, 1330, 269, 32495, 62, 1462, 62, 69, 993, 34032 ]
3.933333
15
txt = str('S') desconto = int(0) while txt == 'S': valor = float(input('Insira o valor do carro (sem desconto): ')) ano = int(input('Insira o ano de fabricação do veículo: ')) if ano <= 2010: desconto = float(valor * 0.2) elif ano <= 2020: desconto = float(valor * 0.15) elif ano > 2...
[ 14116, 796, 965, 10786, 50, 11537, 198, 8906, 3642, 78, 796, 493, 7, 15, 8, 198, 198, 4514, 256, 742, 6624, 705, 50, 10354, 198, 220, 220, 220, 1188, 273, 796, 12178, 7, 15414, 10786, 20376, 8704, 267, 1188, 273, 466, 1097, 305, 3...
2.121019
314
# -*- coding: utf-8 -*- import abc import os import torchvision.transforms as transforms from DLtorch.base import BaseComponent
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 450, 66, 198, 11748, 28686, 198, 198, 11748, 28034, 10178, 13, 7645, 23914, 355, 31408, 198, 198, 6738, 23641, 13165, 354, 13, 8692, 1330, 7308, 21950, 628 ]
3.069767
43
from __future__ import division """Implementation of naive and inefficient mandelbrot calculator.""" import mandelbrot import math logger = mandelbrot.get_logger(__name__) class NaiveCalculator(mandelbrot.MandelbrotCalculator): """See parrent.""" file_name_data = "naive_data.csv" file_name_plot = "naive...
[ 6738, 11593, 37443, 834, 1330, 7297, 198, 37811, 3546, 32851, 286, 24354, 290, 30904, 6855, 417, 7957, 83, 28260, 526, 15931, 198, 198, 11748, 6855, 417, 7957, 83, 198, 11748, 10688, 198, 198, 6404, 1362, 796, 6855, 417, 7957, 83, 13, ...
1.882784
546
import pytest from listlookup import ListLookup sample_list = [ {"id": 1, "country": "us", "name": "Atlanta"}, {"id": 2, "country": "us", "name": "Miami"}, {"id": 3, "country": "uk", "name": "Britain"}, {"id": 5, "country": "uk", "name": "Bermingham"}, {"id": 4, "country": "ca", "name": "Barrie"},...
[ 11748, 12972, 9288, 198, 198, 6738, 1351, 5460, 929, 1330, 7343, 8567, 929, 198, 198, 39873, 62, 4868, 796, 685, 198, 220, 220, 220, 19779, 312, 1298, 352, 11, 366, 19315, 1298, 366, 385, 1600, 366, 3672, 1298, 366, 43482, 25719, 198,...
2.564784
301
from uniclass_to_nf_ea_com_source.b_code.configurations.common_constants.uniclass_bclearer_constants import \ UNICLASS2015_TOP_LEVEL_OBJECTS_TABLE_NAME
[ 6738, 28000, 31172, 62, 1462, 62, 77, 69, 62, 18213, 62, 785, 62, 10459, 13, 65, 62, 8189, 13, 11250, 20074, 13, 11321, 62, 9979, 1187, 13, 46903, 31172, 62, 65, 2375, 11258, 62, 9979, 1187, 1330, 3467, 198, 220, 220, 220, 4725, 2...
2.532258
62
import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from tensorflow.keras.optimizers import SGD, Adam from tensorflow.keras.callbacks import History, EarlyStopping from tensorflow.keras.layers import Dense, Dropout, Flatten, Conv...
[ 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 198, 6738, 1341, 35720, 13, 19849, 62, 49283, 1330, 4512, 62, 9288, 62, 35312, 198, 6738, 1341, 35720, 13, 3866, 36948, 1330, 8997, 3351, 36213, 198, 198, 6738, ...
3.2
200
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_colmet_collector ---------------------------------- Tests for `colmet_collector` module. """ import unittest from colmet_collector import colmet_collector
[ 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, 198, 9288, 62, 4033, 4164, 62, 33327, 273, 198, 3880, 438, 198, 198, 51, 3558, 329, 4600, 4033, 4164...
2.918919
74
# Python stubs generated by omniidl from ..\..\..\..\..\idl\COS\CosNaming.idl # DO NOT EDIT THIS FILE! import omniORB, _omnipy from omniORB import CORBA, PortableServer _0_CORBA = CORBA _omnipy.checkVersion(4,2, __file__, 1) try: property except NameError: # # Start of module "CosNaming" # _...
[ 2, 11361, 17071, 82, 7560, 416, 39030, 8461, 312, 75, 422, 11485, 59, 492, 59, 492, 59, 492, 59, 492, 59, 312, 75, 59, 34, 2640, 59, 36734, 45, 3723, 13, 312, 75, 201, 198, 2, 8410, 5626, 48483, 12680, 45811, 0, 201, 198, 201, ...
2.475428
5,494
# -*- coding: utf-8 -*- """ Created on Fri Apr 3 07:52:07 2020 @author: SungJun Won This code is written based on WEC-sim. wonsungjun0000@gmail.com Note: readData method is included to import data type of both .txt and .mat Note: irregularWaveSpectrum method has been modified for the faster computation. The or...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 19480, 2758, 220, 513, 8753, 25, 4309, 25, 2998, 12131, 198, 198, 31, 9800, 25, 29802, 22396, 23306, 198, 198, 1212, 2438, 318, 3194, 1912, 319, ...
3.060669
478
""" AOC2020 - day1 """ import sys; FILEPATH = "./day1.txt"; with open(FILEPATH) as fp: lines = fp.readlines(); EXISTING = []; for line in lines: val = int(line); ## part 1 # for i in EXISTING: # if val + i == 2020: # print(val * i); ...
[ 37811, 201, 198, 32, 4503, 42334, 532, 1110, 16, 201, 198, 37811, 201, 198, 11748, 25064, 26, 201, 198, 201, 198, 25664, 34219, 796, 366, 19571, 820, 16, 13, 14116, 8172, 201, 198, 201, 198, 4480, 1280, 7, 25664, 34219, 8, 355, 277,...
1.708108
370
import itertools import torch class Kernel: """ Base class for kernels """
[ 11748, 340, 861, 10141, 198, 11748, 28034, 198, 198, 4871, 32169, 25, 198, 220, 220, 220, 37227, 7308, 1398, 329, 50207, 37227, 198 ]
3.478261
23
# Copyright 2018 The Cirq Developers # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
[ 2, 15069, 2864, 383, 21239, 80, 34152, 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,...
2.561576
6,496
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import numpy as np import random import os import pandas as pd import torch import torch.utils.data from torchvision import transforms import slowfast.utils.logging as logging from .build import DATASET_REGISTRY from .epic...
[ 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, 11748, 299, 32152, 355, 45941, 198, 11748, 4738, 198, 11748, 28686, 198, 11748, 19...
3.348315
178
# Copyright (c) 2015 Ericsson AB. # 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 applicab...
[ 2, 15069, 357, 66, 8, 1853, 7651, 16528, 9564, 13, 198, 2, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 345, 743, 198, 2, 407, 779, 428, 2393, 2845, ...
3.724138
203
import copy from collections import OrderedDict from typing import List, Dict, Any from spine_json_lib.data.data_types.base_type import SpineData
[ 11748, 4866, 198, 6738, 17268, 1330, 14230, 1068, 35, 713, 198, 6738, 19720, 1330, 7343, 11, 360, 713, 11, 4377, 198, 198, 6738, 19656, 62, 17752, 62, 8019, 13, 7890, 13, 7890, 62, 19199, 13, 8692, 62, 4906, 1330, 1338, 500, 6601, 6...
3.386364
44
"""This module tests config.py.""" from typing import Dict import pytest from alias_cd import config @pytest.fixture def config_data() -> str: """Sample config data in yaml format.""" return """--- "~": _alias: root my_long_directory_1: _alias: d1 my_sub_directory_1: _alias: ...
[ 37811, 1212, 8265, 5254, 4566, 13, 9078, 526, 15931, 198, 198, 6738, 19720, 1330, 360, 713, 198, 11748, 12972, 9288, 198, 6738, 16144, 62, 10210, 1330, 4566, 628, 198, 31, 9078, 9288, 13, 69, 9602, 198, 4299, 4566, 62, 7890, 3419, 461...
2.186178
709
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 功能实现:检查列表中的所有值是否都是唯一的。 解读: 在给定的列表中使用set()来保持唯一的出现。 使用len()将唯一值的长度与原始列表进行比较。 """ # Examples x = [1, 2, 3, 4, 5, 6] y = [1, 2, 2, 3, 4, 5] print(all_unique(x)) print(all_unique(y)) # output: # True # False
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 27950, 253, 47797, 121, 22522, 252, 163, 236, 108, 171, 120, 248, 162, 96, 222, 162, 253, 98, 26344, 245,...
1.151111
225
from output.models.ms_data.regex.specials_xsd.specials import Doc __all__ = [ "Doc", ]
[ 6738, 5072, 13, 27530, 13, 907, 62, 7890, 13, 260, 25636, 13, 20887, 82, 62, 87, 21282, 13, 20887, 82, 1330, 14432, 198, 198, 834, 439, 834, 796, 685, 198, 220, 220, 220, 366, 23579, 1600, 198, 60, 198 ]
2.358974
39
{%- from "taiga/map.jinja" import server with context -%} # -*- coding: utf-8 -*- from kombu import Queue broker_url = 'amqp{% if server.message_queue.get('ssl', False) %}s{% endif %}://{{ server.message_queue.user }}:{{ server.message_queue.password }}@{{ server.message_queue.host }}:{{ server.message_queue.get('por...
[ 90, 33963, 422, 366, 8326, 13827, 14, 8899, 13, 18594, 6592, 1, 1330, 4382, 351, 4732, 532, 4, 92, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 479, 2381, 84, 1330, 4670, 518, 198, 198, 7957, 61...
2.663793
348
import glob, os, json import logging import numpy as np logger = logging.Logger("vdb") def seg2bb(obj_mask): ''' Convert binary seg mask of object to bouding box, (x0, y0, x1, y1) format ''' y, x = np.where(obj_mask == True) bb = [x.min(), x.max(), y.min(), y.max()] return bb def get_obj_mask(seg_im...
[ 11748, 15095, 11, 28686, 11, 33918, 198, 11748, 18931, 198, 11748, 299, 32152, 355, 45941, 198, 198, 6404, 1362, 796, 18931, 13, 11187, 1362, 7203, 85, 9945, 4943, 628, 198, 4299, 384, 70, 17, 11848, 7, 26801, 62, 27932, 2599, 198, 22...
2.229102
323
import tushare as ts import matplotlib.pyplot as plt import matplotlib.finance as mpf from matplotlib.pylab import date2num import datetime import time import os import pandas as pd import sys from multiprocessing.dummy import Pool as ThreadPool stockBasicInfo=None myG={} workingStock=[] blackList=["000033"] lastTrad...
[ 171, 119, 123, 11748, 256, 1530, 533, 355, 40379, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 2603, 29487, 8019, 13, 69, 14149, 355, 29034, 69, 198, 6738, 2603, 29487, 8019, 13, 79, 2645, 397, 1330, 3128,...
2.173109
595
# Built in python libs import os import time # Additional libs import numpy as np import cv2 from numba import jit # Custom imports try: from logger.logger import Logger import utilities.exceptions from cameras.CaptureManager import CaptureManager, createCaptureSourceData from cameras.DisplayManager ...
[ 2, 28477, 287, 21015, 9195, 82, 198, 11748, 28686, 198, 11748, 640, 198, 198, 2, 15891, 9195, 82, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 269, 85, 17, 198, 6738, 997, 7012, 1330, 474, 270, 198, 198, 2, 8562, 220, 17944, 198,...
2.894495
1,744
import retro
[ 11748, 12175 ]
6
2
import csv import os import re import time from selenium.webdriver.support.select import Select from Data.parameters import Data from filenames import file_extention from get_dir import pwd from reuse_func import GetData
[ 11748, 269, 21370, 198, 11748, 28686, 198, 11748, 302, 198, 11748, 640, 198, 198, 6738, 384, 11925, 1505, 13, 12384, 26230, 13, 11284, 13, 19738, 1330, 9683, 198, 198, 6738, 6060, 13, 17143, 7307, 1330, 6060, 198, 6738, 1226, 268, 1047,...
3.555556
63
num1 = float(input('Digite o primeiro número: ')) num2 = float(input('Digite o segundo: ')) num3 = float(input('Digite o terceiro: ')) # Para descobrir qual o maior: maior = num1 if num2 > maior: maior = num2 if num3 > maior: maior = num3 print(f'O maior número é {maior}') # Para descobrir qual o menor: meno...
[ 22510, 16, 796, 12178, 7, 15414, 10786, 19511, 578, 267, 6994, 7058, 299, 21356, 647, 78, 25, 705, 4008, 198, 22510, 17, 796, 12178, 7, 15414, 10786, 19511, 578, 267, 384, 70, 41204, 25, 705, 4008, 198, 22510, 18, 796, 12178, 7, 154...
2.18593
199
""" Write a program to construct aBayesian network considering medical data. Use this model to demonstrate the diagnosis of heart patients using standard Heart Disease Data Set. You can use Java/Python ML library classes/API. """ import numpy as np import pandas as pd import csv from pgmpy.estimators import Maximu...
[ 37811, 198, 198, 16594, 257, 1430, 284, 5678, 257, 15262, 35610, 3127, 6402, 3315, 1366, 13, 5765, 428, 2746, 284, 10176, 262, 13669, 286, 2612, 3871, 1262, 3210, 8894, 17344, 6060, 5345, 13, 921, 460, 779, 7349, 14, 37906, 10373, 5888,...
3.016227
493
import cv2 import numpy as np from keras.models import load_model from skimage.transform import resize, pyramid_reduce model = load_model('model.h5') while True: cam_capture = cv2.VideoCapture(0) _, image_frame = cam_capture.read() # Select ROI im2 = crop_image(image_frame, 300,300,300,300) ...
[ 11748, 269, 85, 17, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 41927, 292, 13, 27530, 1330, 3440, 62, 19849, 198, 6738, 1341, 9060, 13, 35636, 1330, 47558, 11, 27944, 62, 445, 7234, 198, 198, 19849, 796, 3440, 62, 19849, 10786, 19...
2.195817
526
import re import os from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, HtmlResponse from scrapy.utils.response import get_base_url from scrapy.utils.url import urljoin_rfc from urllib import urlencode import hashlib import csv from product_spiders.item...
[ 11748, 302, 198, 11748, 28686, 198, 198, 6738, 15881, 88, 13, 2777, 1304, 1330, 7308, 41294, 198, 6738, 15881, 88, 13, 19738, 273, 1330, 367, 20369, 55, 15235, 17563, 273, 198, 6738, 15881, 88, 13, 4023, 1330, 19390, 11, 367, 20369, 3...
2.869822
169
import tensorflow as tf from tensorflow.keras.layers import LSTM, Dense from tensorflow.keras.models import Sequential from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions f...
[ 11748, 11192, 273, 11125, 355, 48700, 198, 6738, 11192, 273, 11125, 13, 6122, 292, 13, 75, 6962, 1330, 406, 2257, 44, 11, 360, 1072, 198, 6738, 11192, 273, 11125, 13, 6122, 292, 13, 27530, 1330, 24604, 1843, 198, 6738, 384, 11925, 150...
3.690583
223
from .one_hot import one_hot from .get_file import get_file from .tensor_type import TensorType from .list_recursive_subclasses import list_recursive_concrete_subclasses
[ 6738, 764, 505, 62, 8940, 1330, 530, 62, 8940, 198, 6738, 764, 1136, 62, 7753, 1330, 651, 62, 7753, 198, 6738, 764, 83, 22854, 62, 4906, 1330, 309, 22854, 6030, 198, 6738, 764, 4868, 62, 8344, 30753, 62, 7266, 37724, 1330, 1351, 62,...
3.269231
52
import re from subprocess import Popen, PIPE from board.Board import BLACK, NONE, getOtherColor, getPieceSymbol, WHITE, getDirection, Board from move.Move import MoveNode from move.MovementFactory import generate_moves from players.Player import Player
[ 11748, 302, 198, 6738, 850, 14681, 1330, 8099, 268, 11, 350, 4061, 36, 198, 6738, 3096, 13, 29828, 1330, 31963, 11, 399, 11651, 11, 651, 6395, 10258, 11, 651, 47, 8535, 13940, 23650, 11, 44925, 11, 651, 35, 4154, 11, 5926, 198, 6738...
3.657143
70
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import requests BASE_URL = 'http://codeforces.com/api/' contest_standings = method('contest.standings') user_info = method('user.info')
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 11748, 7007, 628, 198, 33, 11159, 62, 21886, 796, 705, 4023, 1378, 19815, 891, 273, 728, 13, 785, 14, 15042, 14, ...
2.506667
75
""" This encoding is an interface between neural networks and the robot blueprint It is used to create a 'tree' structure that is interpreted as a robot. """ import numpy as np import copy import random from Encodings import abstract_encoding as enc import Tree as tree_structure from NeuralNetwork import NEAT_NN fro...
[ 37811, 198, 1212, 21004, 318, 281, 7071, 1022, 17019, 7686, 290, 262, 9379, 30881, 198, 1026, 318, 973, 284, 2251, 257, 705, 21048, 6, 4645, 326, 318, 16173, 355, 257, 9379, 13, 220, 198, 37811, 198, 198, 11748, 299, 32152, 355, 45941...
3.24968
781
from django.conf import settings from .sender_controller import TaskSender from sparrow_cloud.registry.service_discovery import consul_service from sparrow_cloud.restclient.exception import HTTPException from functools import lru_cache import time # # @lru_cache(maxsize=None) # def get_tasks_sender_object(message_back...
[ 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 764, 82, 2194, 62, 36500, 1330, 15941, 50, 2194, 198, 6738, 599, 6018, 62, 17721, 13, 2301, 4592, 13, 15271, 62, 67, 40821, 1330, 762, 377, 62, 15271, 198, 6738, 599, 6018, 62, 1...
1.797166
1,129
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University # Copyright (c) 2011, 2012 Open Networking Foundation # Copyright (c) 2012, 2013 Big Switch Networks, Inc. # See the file LICENSE.pyloxi which should have been included in the source distribution # Automatically generated by LOXI from ...
[ 2, 15069, 357, 66, 8, 3648, 383, 5926, 286, 9870, 2841, 286, 383, 406, 8822, 13863, 20000, 2059, 198, 2, 15069, 357, 66, 8, 2813, 11, 2321, 4946, 7311, 278, 5693, 198, 2, 15069, 357, 66, 8, 2321, 11, 2211, 4403, 14645, 27862, 11, ...
2.747899
357
from classes.IP.IPGrepr import IPGrepr from classes.IP.utils import handle_mask_or_no_mask
[ 6738, 6097, 13, 4061, 13, 4061, 43887, 1050, 1330, 6101, 43887, 1050, 198, 6738, 6097, 13, 4061, 13, 26791, 1330, 5412, 62, 27932, 62, 273, 62, 3919, 62, 27932, 198 ]
3.033333
30
from rlkit.torch.sac.policies import ScriptPolicy import argparse import json import torch from torch.utils.data import Dataset, DataLoader import os import pandas as pd import numpy as np from collections import deque import cv2 import albumentations as A import copy from clothmanip.envs.template_renderer import Templ...
[ 6738, 374, 75, 15813, 13, 13165, 354, 13, 30584, 13, 79, 4160, 444, 1330, 12327, 36727, 198, 11748, 1822, 29572, 198, 11748, 33918, 198, 11748, 28034, 198, 6738, 28034, 13, 26791, 13, 7890, 1330, 16092, 292, 316, 11, 6060, 17401, 198, ...
2.923695
249
""" http://adventofcode.com/2015/day/4 """ from hashlib import md5 # pylint: disable=inconsistent-return-statements def validate_hash(input_str, num_zeros): """Check if hex md5 starts with '00000'""" if md5(input_str.encode('utf-8')).hexdigest().startswith('0'*num_zeros): return input_str def find_m...
[ 37811, 2638, 1378, 324, 1151, 1659, 8189, 13, 785, 14, 4626, 14, 820, 14, 19, 37227, 198, 6738, 12234, 8019, 1330, 45243, 20, 628, 198, 2, 279, 2645, 600, 25, 15560, 28, 1939, 684, 7609, 12, 7783, 12, 14269, 3196, 198, 4299, 26571, ...
2.603604
222
from DoubleLinkedList import DLinkedList as dList class Mt: """ :raise Exception("BAD DELTA ELEMENT") """ @classmethod def from_text(cls, text: str): """ :raise Exception("BAD DELTA ELEMENT") """ obj = cls() lines = text.splitlines() flag = 'alphabe...
[ 6738, 11198, 11280, 276, 8053, 1330, 360, 11280, 276, 8053, 355, 288, 8053, 628, 198, 4871, 18632, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 1058, 40225, 35528, 7203, 33, 2885, 28163, 5603, 40342, 10979, 4943, 198, 220, 220, ...
1.696817
1,194
#!/usr/bin/env python # encoding: utf-8 """ The database connection management """ from __future__ import print_function import datetime import json import logging import os import re import subprocess import tempfile from mongokit import Connection from .common import hash_password from .play import Play, PlayMigr...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 21004, 25, 3384, 69, 12, 23, 198, 198, 37811, 198, 464, 6831, 4637, 4542, 198, 37811, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 198, 11748, 4818, 8079, 198, 11748, ...
2.19
3,300
from Board import Board class Engine(object): """ Takes a board position and returns the best move """ INF = 1000000 def evaluate(self, depth=0): """ Returns a numeric evaluation of the position Written from the perspective of Tiger """ winner = self.board...
[ 6738, 5926, 1330, 5926, 628, 198, 4871, 7117, 7, 15252, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 33687, 257, 3096, 2292, 290, 5860, 262, 1266, 1445, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 45594, 796, 1802, 2388, ...
2.345588
272
# coding=utf-8 from contracts import contract from geometry.utils import assert_allclose import numpy as np from .matrix_linear_space import MatrixLinearSpace __all__ = ['Euclidean', 'R', 'R1', 'R2', 'R3'] class Euclidean(MatrixLinearSpace): ''' This is the usual Euclidean space of finite dimension; ...
[ 2, 19617, 28, 40477, 12, 23, 198, 6738, 8592, 1330, 2775, 198, 6738, 22939, 13, 26791, 1330, 6818, 62, 439, 19836, 198, 11748, 299, 32152, 355, 45941, 198, 198, 6738, 764, 6759, 8609, 62, 29127, 62, 13200, 1330, 24936, 14993, 451, 141...
2.590909
264
from django.urls import path import mainapp.views as mainapp app_name = 'mainapp' urlpatterns = [ path('', mainapp.index, name='index'), path('cabinet/', mainapp.cabinet, name='cabinet'), path('cabinet/profile/', mainapp.profile, name='profile'), path('cabinet/profile/edit/', mainapp.edit_profile, ...
[ 6738, 42625, 14208, 13, 6371, 82, 1330, 3108, 198, 198, 11748, 1388, 1324, 13, 33571, 355, 1388, 1324, 198, 198, 1324, 62, 3672, 796, 705, 12417, 1324, 6, 198, 198, 6371, 33279, 82, 796, 685, 628, 220, 220, 220, 3108, 10786, 3256, 1...
2.731638
354
#!/usr/bin/env python3 """ Building Skills in Object-Oriented Design V4 The blackjack module includes the Suit class and Card class hierarchy. :author: S. Lott :license: http://creativecommons.org/licenses/by-nc-nd/3.0/us/ """ from typing import Any import enum class Suit(enum.Enum): """Enumerated suit names an...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 37811, 198, 25954, 20389, 287, 9515, 12, 46, 380, 4714, 8495, 569, 19, 198, 198, 464, 2042, 19650, 8265, 3407, 262, 28871, 1398, 290, 5172, 1398, 18911, 13, 198, 198, 25, 9800, 2...
2.358744
1,338
# Copyright 2019 Xanadu Quantum Technologies Inc. # 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 agre...
[ 2, 15069, 13130, 47482, 324, 84, 29082, 21852, 3457, 13, 198, 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,...
2.341603
6,127
# This solution counts how many times the words "fizz" and "buzz" appear in a range provided by the user # The input has to be a valid positive integer # The current count of the word is shown each time the word appears, and a random expression for FizzBuzz # Author: @moisesjsalmeida import random fizz = 0 buzz = 0 ...
[ 2, 770, 4610, 9853, 703, 867, 1661, 262, 2456, 366, 69, 6457, 1, 290, 366, 65, 4715, 1, 1656, 287, 257, 2837, 2810, 416, 262, 2836, 198, 2, 383, 5128, 468, 284, 307, 257, 4938, 3967, 18253, 198, 2, 383, 1459, 954, 286, 262, 1573...
2.229091
550
#! python3 import sys import json import serial from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QSpinBox, \ QGridLayout, QPushButton, QGroupBox, QVBoxLayout from PyQt5.QtCore import QTimer COMPORT = "/dev/cu.usbmodemfd121" if __name__ == "__main__": app = QApplication(sys.argv) w = CtrlTest...
[ 2, 0, 21015, 18, 198, 198, 11748, 25064, 198, 11748, 33918, 198, 11748, 11389, 198, 6738, 9485, 48, 83, 20, 13, 48, 83, 54, 312, 11407, 1330, 1195, 23416, 11, 1195, 38300, 11, 1195, 33986, 11, 1195, 4561, 259, 14253, 11, 3467, 198, ...
2.414966
147
"""A port of dweetio-client's (the official javascript one, to python) """ # stdlib imports import os import subprocess import unittest import uuid # local imports import ts_dweepy test_data = { 'hello': "world", 'somenum': 6816513845, } test_lock = os.environ.get('DWEET_LOCK') test_key = os.environ.get('DW...
[ 37811, 32, 2493, 286, 288, 7277, 952, 12, 16366, 338, 357, 1169, 1743, 44575, 530, 11, 284, 21015, 8, 198, 37811, 198, 2, 14367, 8019, 17944, 198, 11748, 28686, 198, 11748, 850, 14681, 198, 11748, 555, 715, 395, 198, 11748, 334, 27112...
2.685393
178