content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
from functools import reduce from math import factorial if __name__ == '__main__': main()
[ 6738, 1257, 310, 10141, 1330, 4646, 198, 6738, 10688, 1330, 1109, 5132, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1388, 3419 ]
3.166667
30
import pytest from hotel import Hotel
[ 11748, 12972, 9288, 198, 6738, 7541, 1330, 12696, 628 ]
4.333333
9
###################################################################################################################### # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # ...
[ 29113, 29113, 29113, 14468, 4242, 2235, 198, 2, 220, 15069, 6186, 13, 785, 11, 3457, 13, 393, 663, 29116, 13, 1439, 6923, 33876, 13, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 22...
1.902247
890
##################################################################################################### # PARETO was produced under the DOE Produced Water Application for Beneficial Reuse Environmental # Impact and Treatment Optimization (PARETO), and is copyright (c) 2021 by the software owners: The # Regents of the Uni...
[ 29113, 29113, 29113, 4242, 2, 198, 2, 29463, 2767, 46, 373, 4635, 739, 262, 46984, 21522, 771, 5638, 15678, 329, 19899, 6652, 797, 1904, 13272, 198, 2, 17677, 290, 21415, 30011, 1634, 357, 27082, 2767, 46, 828, 290, 318, 6634, 357, 66...
3.639151
848
import requests from pprint import pprint import redis import json from datetime import datetime from config_snips import cluster_config if __name__ == '__main__': github = 'https://github.com/natemellendorf/tr_templates' gitlab = 'http://gitlab/root/awesome' test = get_ext_repo(gitlab) pprint(test)...
[ 11748, 7007, 198, 6738, 279, 4798, 1330, 279, 4798, 198, 11748, 2266, 271, 198, 11748, 33918, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 4566, 62, 16184, 2419, 1330, 13946, 62, 11250, 628, 628, 198, 361, 11593, 3672, 834, 6624,...
2.815789
114
import heterocl as hcl import numpy as np import time import os ######################################### HELPER FUNCTIONS ######################################### # Update the value function at position (i,j,k,l) # iVals: holds index values (i,j,k,l) that correspond to state values (si,sj,sk,sl) # intermeds: ...
[ 11748, 14445, 38679, 355, 289, 565, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 640, 198, 11748, 28686, 198, 198, 29113, 7804, 2, 36255, 18973, 29397, 4177, 11053, 1303, 29113, 7804, 628, 198, 2, 10133, 262, 1988, 2163, 379, 2292, 3...
3.966565
329
from django import template from blog.models import Category register = template.Library() def get_categories(context, order, count): """Получаю список категорий""" # categories = Category.objects.filter(published=True, parent__isnull=True).order_by(order) categories = Category.objects.filter(published=...
[ 6738, 42625, 14208, 1330, 11055, 198, 198, 6738, 4130, 13, 27530, 1330, 21743, 198, 198, 30238, 796, 11055, 13, 23377, 3419, 628, 198, 4299, 651, 62, 66, 26129, 7, 22866, 11, 1502, 11, 954, 2599, 198, 220, 220, 220, 37227, 140, 253, ...
2.614754
366
#!/usr/bin/env python3 # http://adventofcode.com/2017/day/4 import sys if __name__ == '__main__': main(sys.argv)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 2, 2638, 1378, 324, 1151, 1659, 8189, 13, 785, 14, 5539, 14, 820, 14, 19, 198, 198, 11748, 25064, 628, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, ...
2.236364
55
from django.contrib import admin from models import Bucketlist, Item admin.site.register(Bucketlist) admin.site.register(Item)
[ 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 6738, 4981, 1330, 48353, 4868, 11, 9097, 198, 198, 28482, 13, 15654, 13, 30238, 7, 33, 38811, 4868, 8, 198, 28482, 13, 15654, 13, 30238, 7, 7449, 8, 198 ]
3.368421
38
# # Copyright (C) 2020 GrammaTech, Inc. # # This code is licensed under the MIT license. See the LICENSE file in # the project root for license terms. # # This project is sponsored by the Office of Naval Research, One Liberty # Center, 875 N. Randolph Street, Arlington, VA 22203 under contract # # N68335-17-C-0700. Th...
[ 2, 198, 2, 15069, 357, 34, 8, 12131, 20159, 2611, 17760, 11, 3457, 13, 198, 2, 198, 2, 770, 2438, 318, 11971, 739, 262, 17168, 5964, 13, 4091, 262, 38559, 24290, 2393, 287, 198, 2, 262, 1628, 6808, 329, 5964, 2846, 13, 198, 2, 1...
2.223684
760
from .login import LoginView, SocialLoginView from .logout import LogoutView from .register import RegisterView, VerifyView, ActivateView from .profile import ProfileView from .change_password import ChangePasswordView from .reset_password import ResetPasswordView, ResetPasswordConfirmView, ResetPasswordCompleteView fr...
[ 6738, 764, 38235, 1330, 23093, 7680, 11, 5483, 47790, 7680, 198, 6738, 764, 6404, 448, 1330, 5972, 448, 7680, 198, 6738, 764, 30238, 1330, 17296, 7680, 11, 49899, 7680, 11, 33120, 7680, 198, 6738, 764, 13317, 1330, 13118, 7680, 198, 673...
4.444444
81
from django.contrib import admin from .models import Post, Comments # Register your models here. admin.site.register(Post) admin.site.register(Comments)
[ 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 6738, 764, 27530, 1330, 2947, 11, 19502, 198, 2, 17296, 534, 4981, 994, 13, 198, 198, 28482, 13, 15654, 13, 30238, 7, 6307, 8, 198, 28482, 13, 15654, 13, 30238, 7, 23903, 8, 628 ]
3.604651
43
# Generated from UnitX.g4 by ANTLR 4.5.1 from antlr4 import * # This class defines a complete listener for a parse tree produced by UnitXParser. # Enter a parse tree produced by UnitXParser#program. # Exit a parse tree produced by UnitXParser#program. # Enter a parse tree produced by UnitXParser#typeDe...
[ 2, 2980, 515, 422, 11801, 55, 13, 70, 19, 416, 3537, 14990, 49, 604, 13, 20, 13, 16, 198, 6738, 1885, 14050, 19, 1330, 1635, 198, 198, 2, 770, 1398, 15738, 257, 1844, 24783, 329, 257, 21136, 5509, 4635, 416, 11801, 27481, 28198, 1...
3.404858
1,235
from copy import deepcopy import cv2 as cv import numpy as np from sortedcontainers import SortedDict import vision.utils.box_utils_numpy as box_utils from wagon_tracking.transforms import ImageDownscaleTransform
[ 6738, 4866, 1330, 2769, 30073, 198, 198, 11748, 269, 85, 17, 355, 269, 85, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 23243, 3642, 50221, 1330, 311, 9741, 35, 713, 198, 198, 11748, 5761, 13, 26791, 13, 3524, 62, 26791, 62, 77, 3...
3.453125
64
from __future__ import annotations from collections import defaultdict from math import ceil from typing import Dict, NamedTuple from random import randint, sample if __name__ == "__main__": # g = Graph.random_generator(10, 0.2) # print(g) # print(len(g["0"].values())) for i in (0.25, 0.5, 1): ...
[ 6738, 11593, 37443, 834, 1330, 37647, 198, 6738, 17268, 1330, 4277, 11600, 198, 6738, 10688, 1330, 2906, 346, 198, 6738, 19720, 1330, 360, 713, 11, 34441, 51, 29291, 198, 6738, 4738, 1330, 43720, 600, 11, 6291, 628, 628, 198, 361, 11593...
2.519481
154
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Nov 30 14:04:57 2020 @author: mike_ubuntu """ from copy import deepcopy import numpy as np
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 201, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 37811, 201, 198, 41972, 319, 2892, 5267, 1542, 1478, 25, 3023, 25, 3553, 12131, 201, 198, 201, 198, 31,...
1.881818
110
#!/usr/bin/env python import rospy import math from sensor_msgs.msg import Joy from geometry_msgs.msg import Twist if __name__ == '__main__': rospy.init_node('joy_twist') joy_twist = JoyTwist() rospy.spin()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 11748, 686, 2777, 88, 198, 11748, 10688, 198, 6738, 12694, 62, 907, 14542, 13, 19662, 1330, 14087, 198, 6738, 22939, 62, 907, 14542, 13, 19662, 1330, 44088, 198, 198, 361, 11593, 3672, ...
2.47191
89
import numpy as np if __name__ == "__main__": # Part 1. assert part1(get_data(7, 'test')) == 37, "Part 1 failed." print(f"Part 1: {part1(get_data(7, 'data')):.0f}") # Part 2. assert part2(get_data(7, 'test')) == 168, "Part 2 failed." print(f"Part 2: {part2(get_data(7, 'data')):.0f}")
[ 11748, 299, 32152, 355, 45941, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 628, 220, 220, 220, 1303, 2142, 352, 13, 198, 220, 220, 220, 6818, 636, 16, 7, 1136, 62, 7890, 7, 22, 11, 705, 9288, 6, 4008, 6624, ...
2.143836
146
"""ADS1220 example (polling ADC). Uses single shot mode and wait for data ready.""" from time import sleep from machine import Pin, SPI # type: ignore from ads1220 import ADC cs = 15 # Chip select pin drdy = 27 # Data ready pin spi = SPI(1, baudrate=10000000, # 10 MHz (try lower speed to troubleshoot)...
[ 37811, 47149, 1065, 1238, 1672, 357, 30393, 278, 49169, 737, 198, 220, 220, 36965, 2060, 2823, 4235, 290, 4043, 329, 1366, 3492, 526, 15931, 198, 6738, 640, 1330, 3993, 198, 6738, 4572, 1330, 13727, 11, 49091, 220, 1303, 2099, 25, 8856,...
2.334638
511
# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
[ 2, 15069, 33448, 383, 309, 22854, 37535, 46665, 13, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846,...
3.84585
253
#!/usr/bin/env python3 # Utility functioins import sys from Crypto.Cipher import AES from Crypto.PublicKey import RSA from Crypto.Signature import PKCS1_v1_5 from Crypto.Signature import pss from Crypto.Hash import SHA256 import array import hashlib import hmac import os import binascii MAX_DOWNLOAD_SIZE = ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 34030, 1257, 310, 952, 1040, 198, 198, 11748, 25064, 198, 6738, 36579, 13, 34, 10803, 1330, 34329, 198, 6738, 36579, 13, 15202, 9218, 1330, 42319, 198, 6738, 36579, 13, 11712, 1...
3.231904
2,169
import csv import requests import socket from bs4 import BeautifulSoup import re import json with open('artists.json', 'w') as outfile: json.dump(parse_artists(), outfile) '''artist_urls = get_artist_urls() artist_array = compile_artist_profiles(artist_urls) outfile = open("./toronto-artists.csv", "wb") writer ...
[ 198, 11748, 269, 21370, 198, 11748, 7007, 198, 11748, 17802, 198, 6738, 275, 82, 19, 1330, 23762, 50, 10486, 198, 11748, 302, 198, 11748, 33918, 198, 198, 4480, 1280, 10786, 433, 1023, 13, 17752, 3256, 705, 86, 11537, 355, 503, 7753, ...
2.772059
136
from __future__ import print_function import sys import re import sqlparse from collections import namedtuple from sqlparse.sql import Comparison, Identifier, Where from .parseutils.utils import ( last_word, find_prev_keyword, parse_partial_identifier) from .parseutils.tables import extract_tables from .parseutils....
[ 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 11748, 25064, 198, 11748, 302, 198, 11748, 44161, 29572, 198, 6738, 17268, 1330, 3706, 83, 29291, 198, 6738, 44161, 29572, 13, 25410, 1330, 34420, 11, 11440, 7483, 11, 6350, 198, 6738, ...
2.736733
1,922
import random from .prepare import app, db, model_repr class Answer(db.Model): ''' 使用的sql语句: ```sql CREATE TABLE `answers` ( `accept_id` int(11) NOT NULL COMMENT '接受id', `problem_id` int(11) NOT NULL COMMENT '问题id', `answer` int(11) NOT NULL DEFAULT '-1' COMMENT '具体答案的选项', ...
[ 11748, 4738, 198, 198, 6738, 764, 46012, 533, 1330, 598, 11, 20613, 11, 2746, 62, 260, 1050, 198, 198, 4871, 23998, 7, 9945, 13, 17633, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 220, 45635, 18796, 101, 21410, 25410, 4...
2.114383
883
""" Clean bioenergy data from AZEL """ import os import json import itertools import geopandas as gpd import pandas as pd os.makedirs('data', exist_ok=True) projection = 'epsg:4326' name = ['pecuarios', 'forestales', 'industriales', 'urbanos'] scenario = ['E3', 'E1'] for scenario, name in itertools.product(scena...
[ 37811, 198, 220, 220, 220, 5985, 13401, 22554, 1366, 422, 26253, 3698, 198, 37811, 198, 11748, 28686, 198, 11748, 33918, 198, 11748, 340, 861, 10141, 198, 11748, 30324, 392, 292, 355, 27809, 67, 198, 11748, 19798, 292, 355, 279, 67, 198...
2.003236
1,236
#the table should be read T[deg][a] where a is the multiplicity of the Q def build1DCeilingTable(c): '''entry for A is max k s.t. l(A) = l(A+kP) and l(A+kQ) ''' max_deg = [0 for _ in range(c.m)] CLP = c.fill_degree_table_reverse(update, max_deg) CLQ = c.fill_degree_table_reverse(update, max_deg) re...
[ 198, 2, 1169, 3084, 815, 307, 1100, 309, 58, 13500, 7131, 64, 60, 810, 257, 318, 262, 15082, 8467, 286, 262, 1195, 198, 4299, 1382, 16, 9697, 68, 4386, 10962, 7, 66, 2599, 198, 220, 220, 220, 705, 7061, 13000, 329, 317, 318, 3509,...
2.229299
157
# 1. Observe os dois métodos de exclusão listados abaixo. # # 2. Identifique a quais estruturas pertencem os métodos, respectivamente. # R: A primeira é Lista duplamente encadeada (double_linked), metodo de remoção. A segunda é Lista encadeada, metodo de remoção # # 3. Explique qual a diferença FUNDAMENTAL entre ...
[ 2, 352, 13, 11086, 3760, 28686, 466, 271, 285, 25125, 375, 418, 390, 10293, 28749, 1351, 22484, 450, 64, 844, 78, 13, 198, 2, 198, 2, 362, 13, 11440, 361, 2350, 257, 627, 15152, 1556, 81, 315, 17786, 22146, 594, 76, 28686, 285, 25...
2.561538
260
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2020 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """CSRF Middleware. The implementation is highly inspred from Django's initial implementa...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 770, 2393, 318, 636, 286, 554, 574, 952, 13, 198, 2, 15069, 357, 34, 8, 12131, 327, 28778, 13, 198, 2, 198, 2, 554, 574, 952, 318, 1479, 3788, 26, 345...
2.362901
2,965
import pytest import unittest from unittest.mock import MagicMock from polymetis import GripperInterface import polymetis_pb2 @pytest.fixture @pytest.mark.parametrize("blocking", [True, False])
[ 11748, 12972, 9288, 198, 11748, 555, 715, 395, 198, 6738, 555, 715, 395, 13, 76, 735, 1330, 6139, 44, 735, 198, 198, 6738, 7514, 4164, 271, 1330, 20914, 2848, 39317, 198, 11748, 7514, 4164, 271, 62, 40842, 17, 628, 198, 31, 9078, 92...
2.970149
67
# Generated by Django 2.2.10 on 2021-01-17 17:26 from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 362, 13, 17, 13, 940, 319, 33448, 12, 486, 12, 1558, 1596, 25, 2075, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.875
32
from pathlib import Path from shutil import copyfile from unittest import mock import click from click.testing import CliRunner from pixivapi import BadApiResponse, LoginError, Visibility from pixi.commands import ( _confirm_table_wipe, _get_starting_bookmark_offset, artist, auth, bookmarks, c...
[ 6738, 3108, 8019, 1330, 10644, 198, 6738, 4423, 346, 1330, 4866, 7753, 198, 6738, 555, 715, 395, 1330, 15290, 198, 198, 11748, 3904, 198, 6738, 3904, 13, 33407, 1330, 1012, 72, 49493, 198, 6738, 279, 844, 452, 15042, 1330, 7772, 32, 1...
2.439873
632
import torch from torch import nn from torch import optim from vae import * from loader import * from skempi_lib import * from torch_utils import * BATCH_SIZE = 32 LR = 1e-3 if __name__ == "__main__": import argparse parser = argparse.ArgumentParser() add_arguments(parser) args = parser.parse_...
[ 11748, 28034, 198, 6738, 28034, 1330, 299, 77, 198, 6738, 28034, 1330, 6436, 198, 198, 6738, 410, 3609, 1330, 1635, 198, 6738, 40213, 1330, 1635, 198, 6738, 6146, 3149, 72, 62, 8019, 1330, 1635, 198, 6738, 28034, 62, 26791, 1330, 1635, ...
2.215596
872
import argparse from src.client.client import ClientHelper import logging from src.data.orders_handler import load_and_process from src.data.preprocessing.orders import OrdersProcessor from src.utils.logging import log_format, log_level logging.basicConfig(format=log_format, level=log_level) if __name__ == '__main__...
[ 11748, 1822, 29572, 198, 198, 6738, 12351, 13, 16366, 13, 16366, 1330, 20985, 47429, 198, 11748, 18931, 198, 198, 6738, 12351, 13, 7890, 13, 6361, 62, 30281, 1330, 3440, 62, 392, 62, 14681, 198, 6738, 12351, 13, 7890, 13, 3866, 36948, ...
3.085911
291
from railroads import Track track = Track("day13-input.txt") track.run_partone() track2 = Track("day13-input.txt") track2.run_parttwo()
[ 6738, 6787, 21372, 1330, 17762, 628, 198, 11659, 796, 17762, 7203, 820, 1485, 12, 15414, 13, 14116, 4943, 198, 11659, 13, 5143, 62, 3911, 505, 3419, 198, 11659, 17, 796, 17762, 7203, 820, 1485, 12, 15414, 13, 14116, 4943, 198, 11659, ...
2.816327
49
""" Extract information about chr16 for several patients for ben """ import pandas as pd crc01_path = r"H:\Study\university\Computational-Biology\Year " \ r"3\Projects\proj_scwgbs\resource\cpg_format\filtered_by_bl_and_cpgi\CRC01\all_cpg_ratios_CRC01_chr16.dummy.pkl.zip" crc11_path = r"H:\Study\universit...
[ 37811, 198, 11627, 974, 1321, 546, 442, 81, 1433, 329, 1811, 3871, 329, 1888, 198, 37811, 198, 198, 11748, 19798, 292, 355, 279, 67, 198, 198, 66, 6015, 486, 62, 6978, 796, 374, 1, 39, 7479, 39841, 59, 403, 1608, 59, 5377, 1996, 8...
1.961573
2,212
from pathlib import PurePath from typing import List from setuptools import find_packages, setup version = '0.0.4' def load_requirements(path: PurePath) -> List[str]: """ Load dependencies from a requirements.txt style file, ignoring comments etc. """ res = [] with open(path) as fd: for line in ...
[ 6738, 3108, 8019, 1330, 17129, 15235, 198, 6738, 19720, 1330, 7343, 198, 198, 6738, 900, 37623, 10141, 1330, 1064, 62, 43789, 11, 9058, 198, 198, 9641, 796, 705, 15, 13, 15, 13, 19, 6, 628, 198, 4299, 3440, 62, 8897, 18883, 7, 6978,...
2.453659
615
from numpy.core.fromnumeric import shape import taichi as ti import numpy as np lin_iters = 20 N = 64 dt = 0.1 diff = 0.0 visc = 0.0 force = 5e5 source = 100.0 dvel = False v = ti.Vector.field(2, float, shape=(N + 2, N + 2), offset = (-1, -1)) v_prev = ti.Vector.field(2, float, shape=(N + 2, N + 2),...
[ 6738, 299, 32152, 13, 7295, 13, 6738, 77, 39223, 1330, 5485, 201, 198, 11748, 20486, 16590, 355, 46668, 201, 198, 11748, 299, 32152, 355, 45941, 201, 198, 201, 198, 2815, 62, 270, 364, 796, 1160, 201, 198, 201, 198, 45, 796, 5598, 2...
2.154545
330
import sys import os os.chdir(os.path.dirname(os.path.realpath(__file__))) sys.path.append(os.path.realpath(os.pardir)) os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cnap_v2.settings') import django from django.conf import settings django.setup() from base.models import AvailableZones, CurrentZone if __name__ =...
[ 11748, 25064, 198, 11748, 28686, 198, 198, 418, 13, 354, 15908, 7, 418, 13, 6978, 13, 15908, 3672, 7, 418, 13, 6978, 13, 5305, 6978, 7, 834, 7753, 834, 22305, 198, 17597, 13, 6978, 13, 33295, 7, 418, 13, 6978, 13, 5305, 6978, 7, ...
2.43309
411
import torch import numpy as np, reward.utils as U from pathlib import Path from .space import Space
[ 11748, 28034, 198, 11748, 299, 32152, 355, 45941, 11, 6721, 13, 26791, 355, 471, 198, 6738, 3108, 8019, 1330, 10644, 198, 6738, 764, 13200, 1330, 4687, 628, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198 ]
3.027027
37
# -*- coding: utf-8 -*- # Generated by Django 1.11.23 on 2020-03-03 13:32 from __future__ import unicode_literals from django.db import migrations
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2980, 515, 416, 37770, 352, 13, 1157, 13, 1954, 319, 12131, 12, 3070, 12, 3070, 1511, 25, 2624, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198...
2.690909
55
import tensorflow as tf from tensorflow.keras import backend as K class OrdinalMeanAbsoluteError(tf.keras.metrics.Metric): """Computes mean absolute error for ordinal labels.""" def __init__(self, name="mean_absolute_error_labels", **kwargs): """Creates a `OrdinalMeanAbsoluteError` i...
[ 11748, 11192, 273, 11125, 355, 48700, 198, 6738, 11192, 273, 11125, 13, 6122, 292, 1330, 30203, 355, 509, 628, 198, 4871, 14230, 1292, 5308, 272, 24849, 3552, 12331, 7, 27110, 13, 6122, 292, 13, 4164, 10466, 13, 9171, 1173, 2599, 198, ...
2.117117
4,440
#https://www.geeksforgeeks.org/puzzle-maximum-number-kings-chessboard-without-check/ if __name__ == '__main__': print(main(9,3))
[ 198, 2, 5450, 1378, 2503, 13, 469, 2573, 30293, 2573, 13, 2398, 14, 79, 9625, 12, 47033, 12, 17618, 12, 74, 654, 12, 2395, 824, 3526, 12, 19419, 12, 9122, 14, 628, 628, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, ...
2.431034
58
# Generated by Django 3.1.4 on 2021-01-10 21:41 from django.db import migrations
[ 2, 2980, 515, 416, 37770, 513, 13, 16, 13, 19, 319, 33448, 12, 486, 12, 940, 2310, 25, 3901, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 628 ]
2.766667
30
# coding=utf-8 import os import threading import logging import utils if utils.getSystem() == utils.System.WINDOWS: from SysTrayIcon import SysTrayIcon trayThread = None tray = None show = True def initTray(): "初始化系统托盘线程" logging.info("Start a new thread to manage system tray.") global trayThread ...
[ 2, 19617, 28, 40477, 12, 23, 198, 198, 11748, 28686, 198, 11748, 4704, 278, 198, 11748, 18931, 198, 11748, 3384, 4487, 198, 361, 3384, 4487, 13, 1136, 11964, 3419, 6624, 3384, 4487, 13, 11964, 13, 33207, 25, 198, 220, 220, 220, 422, ...
2.03949
785
# class Tree: # def __init__(self, val, left=None, right=None): # self.val = val # self.left = left # self.right = right
[ 2, 1398, 12200, 25, 198, 2, 220, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 1188, 11, 1364, 28, 14202, 11, 826, 28, 14202, 2599, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 2100, 796, 1188, 198, 2, 220, 2...
2.041096
73
import logging from django.core.management.base import BaseCommand
[ 11748, 18931, 198, 198, 6738, 42625, 14208, 13, 7295, 13, 27604, 13, 8692, 1330, 7308, 21575, 628 ]
4.058824
17
"""Command-line interfacing workflows""" import argparse import os import sys import imp import inspect import argcomplete from . import core from . common import WorkflowError, WORKFLOW_DEFAULT_FILENAME from . import decorators from . userargument import USER_ARGS_CONTEXT from . _ui import ui from . import _util a...
[ 37811, 21575, 12, 1370, 9556, 4092, 670, 44041, 37811, 628, 198, 11748, 1822, 29572, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 848, 198, 11748, 10104, 198, 198, 11748, 1822, 20751, 198, 198, 6738, 764, 1330, 4755, 198, 6738, 764, ...
2.343819
1,812
#!/usr/bin/env python import rospy import tf import serial import numpy as np from nav_msgs.msg import Odometry from geometry_msgs.msg import Point from std_msgs.msg import Int64 global x, y, theta, v_L, v_R, v_x, v_y, omega x = 0 y = 0 theta = 0 v_L = 0 v_R = 0 v_x = 0 v_y = 0 omega = 0 pub_tf = False # Use estimate ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 11748, 686, 2777, 88, 198, 11748, 48700, 198, 11748, 11389, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 6812, 62, 907, 14542, 13, 19662, 1330, 10529, 15748, 198, 6738, 22939, 62, 907,...
2.371324
272
from nbgrader.auth import JupyterHubAuthPlugin c = get_config() c.Application.log_level = 30 c.Authenticator.plugin_class = JupyterHubAuthPlugin c.Exchange.path_includes_course = True c.Exchange.root = "/srv/nbgrader/exchange" c.ExecutePreprocessor.iopub_timeout=1800 c.ExecutePreprocessor.timeout=3600
[ 6738, 299, 65, 2164, 5067, 13, 18439, 1330, 449, 929, 88, 353, 16066, 30515, 37233, 628, 198, 66, 796, 651, 62, 11250, 3419, 198, 198, 66, 13, 23416, 13, 6404, 62, 5715, 796, 1542, 198, 198, 66, 13, 47649, 26407, 13, 33803, 62, 48...
2.734513
113
from iota import Iota from iota import Address, ProposedTransaction, Tag, Transaction from iota import TryteString from iota import ProposedBundle from iota.commands.extended import utils from datetime import datetime from pprint import pprint import hashlib import time import random import string
[ 6738, 1312, 4265, 1330, 314, 4265, 198, 6738, 1312, 4265, 1330, 17917, 11, 8772, 1335, 48720, 11, 17467, 11, 45389, 198, 6738, 1312, 4265, 1330, 9993, 660, 10100, 198, 6738, 1312, 4265, 1330, 8772, 1335, 33, 31249, 198, 6738, 1312, 4265...
3.710843
83
from __future__ import unicode_literals import datetime from django.contrib import admin from django.contrib.admin.options import IncorrectLookupParameters from django.contrib.admin.templatetags.admin_list import pagination from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase from django.contrib.admi...
[ 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 198, 11748, 4818, 8079, 198, 198, 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 28482, 13, 25811, 1330, 3457, 47315, 8567, 92...
3.127155
464
""" These are emukit model wrappers that contain the specific optimization procedures we found worked well for each model. The constructor for each model takes X and Y as lists, with each entry of the list corresponding to data for a fidelity """ import logging import GPy import numpy as np from ...core.interfaces i...
[ 37811, 198, 4711, 389, 795, 2724, 270, 2746, 7917, 11799, 326, 3994, 262, 2176, 23989, 9021, 356, 1043, 3111, 880, 329, 1123, 2746, 13, 198, 198, 464, 23772, 329, 1123, 2746, 2753, 1395, 290, 575, 355, 8341, 11, 351, 1123, 5726, 286, ...
2.531622
1,091
import argparse import typing import aztk.spark from aztk_cli import log, config
[ 11748, 1822, 29572, 198, 11748, 19720, 198, 11748, 35560, 30488, 13, 2777, 668, 198, 6738, 35560, 30488, 62, 44506, 1330, 2604, 11, 4566, 628, 198 ]
3.32
25
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Copyright (c) 2019, Eurecat / UPF # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of...
[ 2, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, ...
2.356299
3,469
import pandas as pd import sys import math import requests
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 25064, 198, 11748, 10688, 198, 11748, 7007 ]
3.866667
15
""" Given a linked list, find the first node of a cycle in it. 1 -> 2 -> 3 -> 4 -> 5 -> 1 => 1 A -> B -> C -> D -> E -> C => C Note: The solution is a direct implementation Floyd's cycle-finding algorithm (Floyd's Tortoise and Hare). """ def firstCyclicNode(head): """ :type head: ...
[ 37811, 198, 220, 220, 220, 11259, 257, 6692, 1351, 11, 1064, 262, 717, 10139, 286, 257, 6772, 287, 340, 13, 198, 220, 220, 220, 352, 4613, 362, 4613, 513, 4613, 604, 4613, 642, 4613, 352, 220, 5218, 352, 198, 220, 220, 220, 317, 4...
2.489437
284
#! /usr/bin/python import serial import time import requests import datetime import thread import time bluetoothSerial = serial.Serial( "/dev/tty.HC-06-DevB", baudrate=9600 ) serverIP = "localhost" serverPort = "8080" publisherEndpoint = "/ConnectedDevices/pushdata" #"/pushdata/{ip}/{owner}/{type}/{mac}/{time}/{pin...
[ 2, 0, 1220, 14629, 14, 8800, 14, 29412, 198, 11748, 11389, 198, 11748, 640, 198, 11748, 7007, 198, 11748, 4818, 8079, 198, 11748, 4704, 198, 11748, 640, 198, 198, 65, 2290, 16271, 32634, 796, 11389, 13, 32634, 7, 12813, 7959, 14, 4285...
2.553846
260
#### # This sample is published as part of the blog article at www.toptal.com/blog # Visit www.toptal.com/blog and subscribe to our newsletter to read great posts #### import logging import os from concurrent.futures import ThreadPoolExecutor from functools import partial from time import time from download import se...
[ 4242, 198, 2, 770, 6291, 318, 3199, 355, 636, 286, 262, 4130, 2708, 379, 7324, 13, 4852, 39240, 13, 785, 14, 14036, 198, 2, 16440, 7324, 13, 4852, 39240, 13, 785, 14, 14036, 290, 12383, 284, 674, 13129, 284, 1100, 1049, 6851, 198, ...
3.174419
172
from django.utils import translation from django.core.exceptions import ObjectDoesNotExist from django.conf import settings from userena import settings as userena_settings from userena.compat import SiteProfileNotAvailable from userena.utils import get_user_profile class UserenaLocaleMiddleware(object): """ ...
[ 6738, 42625, 14208, 13, 26791, 1330, 11059, 198, 6738, 42625, 14208, 13, 7295, 13, 1069, 11755, 1330, 9515, 13921, 3673, 3109, 396, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 198, 6738, 779, 918, 64, 1330, 6460, 355, 779, 918,...
3.673611
144
""" First Three Words Write a program which asks the user to enter a sentence. Print the first three words in the sentence. (Assume the user enters at least 3 words.) """ sentence = input("Enter a sentence: ") words = sentence.split() for word in words[:3]: print(word)
[ 37811, 198, 5962, 7683, 23087, 198, 198, 16594, 257, 1430, 543, 7893, 198, 1169, 2836, 284, 3802, 257, 6827, 13, 198, 18557, 262, 717, 1115, 2456, 287, 262, 6827, 13, 198, 7, 8021, 2454, 262, 2836, 14170, 379, 1551, 513, 2456, 2014, ...
3.309524
84
# Generated by Django 2.2.5 on 2022-03-02 12:32 from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 362, 13, 17, 13, 20, 319, 33160, 12, 3070, 12, 2999, 1105, 25, 2624, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.84375
32
#!/usr/bin/env python3 import datetime import os import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk, GObject BASEDIR = os.path.dirname(os.path.abspath(__file__)) if __name__ == '__main__': win = StopWatch() icon_path = os.path.join(BASEDIR, 'stopwatch.png') win.set_icon_from_file...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 11748, 4818, 8079, 198, 11748, 28686, 198, 198, 11748, 308, 72, 198, 12397, 13, 46115, 62, 9641, 7203, 38, 30488, 1600, 366, 18, 13, 15, 4943, 198, 6738, 308, 72, 13, 260, 1930, ...
2.318182
176
# Generated by Django 3.0.6 on 2021-01-10 17:55 from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 513, 13, 15, 13, 21, 319, 33448, 12, 486, 12, 940, 1596, 25, 2816, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.84375
32
""" Student management module """ students = [] def get_student_title_case() -> str: """ Function to return student name in title case :return: student name """ students_title_case = [] for student in students: students_title_case.append(student["name"].title()) retur...
[ 37811, 201, 198, 38778, 4542, 8265, 201, 198, 37811, 201, 198, 19149, 658, 796, 17635, 201, 198, 201, 198, 201, 198, 4299, 651, 62, 50139, 62, 7839, 62, 7442, 3419, 4613, 965, 25, 201, 198, 220, 220, 220, 37227, 201, 198, 220, 220, ...
2.532083
1,013
import gym import numpy as np from ray.rllib.utils.annotations import PublicAPI @PublicAPI class Repeated(gym.Space): """Represents a variable-length list of child spaces. Example: self.observation_space = spaces.Repeated(spaces.Box(4,), max_len=10) --> from 0 to 10 boxes of shape (4,) ...
[ 11748, 11550, 198, 11748, 299, 32152, 355, 45941, 198, 198, 6738, 26842, 13, 81, 297, 571, 13, 26791, 13, 34574, 602, 1330, 5094, 17614, 628, 198, 31, 15202, 17614, 198, 4871, 30558, 515, 7, 1360, 76, 13, 14106, 2599, 198, 220, 220, ...
2.822485
169
# common_features.py # Invoke on the command line like: python common_features.py pbtd # Outputs all features common to all of the given segments, to help # in rule writing. from tabulate import tabulate import csv import sys import os.path as path base_directory = path.dirname(path.dirname(path.abspath(__file__))) s...
[ 2, 2219, 62, 40890, 13, 9078, 198, 2, 10001, 2088, 319, 262, 3141, 1627, 588, 25, 21015, 2219, 62, 40890, 13, 9078, 279, 65, 8671, 198, 2, 25235, 82, 477, 3033, 2219, 284, 477, 286, 262, 1813, 17894, 11, 284, 1037, 198, 2, 287, ...
3.018182
220
#!/usr/bin/env python import time import sys # import the MUD server class from mudserver import MudServer, Event, EventType #prints to stderr VERBOSE_PRINT = False # structure defining the rooms in the game. Try adding more rooms to the game! rooms = { "Tavern": { "description": "You're in a cozy taver...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 11748, 640, 198, 11748, 25064, 198, 2, 1330, 262, 337, 8322, 4382, 1398, 198, 6738, 17492, 15388, 1330, 32878, 10697, 11, 8558, 11, 8558, 6030, 198, 198, 2, 17190, 284, 336, 1082, 81, ...
1.928864
4,147
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from mptt.forms import MPTTAdminForm from parler.forms import TranslatableModelForm from shopit.models.flag import Flag
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 11, 28000, 1098, 62, 17201, 874, 198, 198, 6738, 285, 457, 83, 13, 23914, 1330, 4904, 15751, 46787, 8479, 198, 6738, 1582...
3.1875
64
from point import Point from rectangle import Rectangle from utils import areOverlapping
[ 6738, 966, 1330, 6252, 201, 198, 6738, 35991, 1330, 48599, 9248, 201, 198, 6738, 3384, 4487, 1330, 389, 5886, 75, 5912, 201, 198, 201, 198 ]
3.76
25
""" Created by akiselev on 2019-06-13 re.findall() The expression re.findall() returns all the non-overlapping matches of patterns in a string as a list of strings. Code >>> import re >>> re.findall(r'\w','http://www.hackerrank.com/') ['h', 't', 't', 'p', 'w', 'w', 'w', 'h', 'a', 'c', 'k', 'e', 'r', 'r', 'a', 'n...
[ 37811, 628, 15622, 416, 47594, 786, 2768, 319, 13130, 12, 3312, 12, 1485, 198, 220, 198, 302, 13, 19796, 439, 3419, 198, 198, 464, 5408, 302, 13, 19796, 439, 3419, 5860, 477, 262, 1729, 12, 2502, 75, 5912, 7466, 286, 7572, 287, 257,...
2.5968
625
from antlr4 import FileStream, CommonTokenStream from src.Python3Lexer import Python3Lexer from src.Python3Parser import Python3Parser from antlr4.tree.Tree import TerminalNodeImpl from antlr4.error.ErrorListener import ErrorListener import json class FileErrorListener(ErrorListener): """Class for storing errors ...
[ 6738, 1885, 14050, 19, 1330, 9220, 12124, 11, 8070, 30642, 12124, 198, 6738, 12351, 13, 37906, 18, 45117, 263, 1330, 11361, 18, 45117, 263, 198, 6738, 12351, 13, 37906, 18, 46677, 1330, 11361, 18, 46677, 198, 6738, 1885, 14050, 19, 13, ...
2.643644
999
from unplugged import Schema from ...plugins import DatabasePlugin
[ 6738, 555, 16875, 2004, 1330, 10011, 2611, 198, 198, 6738, 2644, 37390, 1330, 24047, 37233, 628 ]
4.3125
16
import GUI from GUI import root, tk, MyButton import ButtonClickHandler as BH from ButtonClickHandler import MainMenuButtons as M
[ 11748, 25757, 201, 198, 6738, 25757, 1330, 6808, 11, 256, 74, 11, 2011, 21864, 201, 198, 11748, 20969, 8164, 25060, 355, 347, 39, 201, 198, 6738, 20969, 8164, 25060, 1330, 8774, 23381, 1537, 27288, 355, 337, 201, 198, 201, 198 ]
3.4
40
import random from copy import deepcopy
[ 11748, 4738, 198, 6738, 4866, 1330, 2769, 30073, 628 ]
4.555556
9
import os from bottle import Bottle, response from whitenoise import WhiteNoise from ..settings import DATA_PATH api = Bottle() @api.hook('after_request') application = WhiteNoise(api) application.add_files(os.path.join(DATA_PATH, 'thumbnails'), prefix='thumbnails/') application.add_files(os.path.join(DATA_PATH...
[ 11748, 28686, 198, 198, 6738, 9294, 1330, 33608, 11, 2882, 198, 6738, 20542, 23397, 786, 1330, 2635, 2949, 786, 198, 198, 6738, 11485, 33692, 1330, 42865, 62, 34219, 628, 198, 15042, 796, 33608, 3419, 628, 198, 31, 15042, 13, 25480, 107...
3.25
108
# for testing only, 'alpha' is included in the preloaded section on Codewars alpha = {'ABCDE': 1, 'FGHIJ': 2, 'KLMNO': 3, 'PQRST': 4, 'UVWXY': 5}
[ 2, 329, 4856, 691, 11, 705, 26591, 6, 318, 3017, 287, 262, 662, 14578, 2665, 319, 18720, 413, 945, 198, 26591, 796, 1391, 6, 24694, 7206, 10354, 352, 11, 705, 37, 17511, 23852, 10354, 362, 11, 705, 42, 31288, 15285, 10354, 513, 11, ...
2.491525
59
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ## # Module for loading and encoding Broombridge data ## import logging from qsharp.chemistry import load_broombridge, load_input_state, encode from typing import List, Tuple NumQubits = int HamiltonianTermList = Tuple[List[Tuple[List[int], List...
[ 2, 15069, 357, 66, 8, 5413, 10501, 13, 198, 2, 49962, 739, 262, 17168, 13789, 13, 198, 198, 2235, 198, 2, 19937, 329, 11046, 290, 21004, 2806, 296, 9458, 1366, 198, 2235, 198, 11748, 18931, 198, 6738, 10662, 48554, 13, 15245, 4592, ...
2.7173
711
from collections import Counter print('Number of words:', word_count('test.txt'))
[ 6738, 17268, 1330, 15034, 201, 198, 201, 198, 4798, 10786, 15057, 286, 2456, 25, 3256, 1573, 62, 9127, 10786, 9288, 13, 14116, 6, 4008, 201, 198 ]
3.307692
26
from __future__ import absolute_import from __future__ import print_function from __future__ import division import time import datetime import torch import torchreid from torchreid.engine import engine from torchreid.losses import CrossEntropyLoss, TripletLoss, HctLoss from torchreid.utils import AverageMeter, open...
[ 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 6738, 11593, 37443, 834, 1330, 7297, 198, 198, 11748, 640, 198, 11748, 4818, 8079, 198, 198, 11748, 28034, 198, 198, 11748, 28034, ...
2.265385
1,040
# crypto/opisthocomus-hoazin e, n = (65537, 15888457769674642859708800597310299725338251830976423740469342107745469667544014118426981955901595652146093596535042454720088489883832573612094938281276141337632202496209218136026441342435018861975571842724577501821204305185018320446993699281538507826943542962060000957702417...
[ 2, 21473, 14, 404, 396, 71, 42829, 385, 12, 8873, 1031, 259, 198, 198, 68, 11, 299, 796, 357, 35916, 2718, 11, 1315, 28011, 2231, 3324, 3388, 3134, 44578, 2078, 3270, 2154, 3459, 405, 3270, 4790, 940, 1959, 5607, 1495, 28460, 1495, ...
2.139423
624
a,b,A,B,l=list(map(int, input().split())), list(map(int, input().split())),0,0,0 for i in range(10): (A,B,l) = (A+3,B,1) if a[i]>b[i] else (A,B+3,2) if a[i]<b[i] else (A+1,B+1,l) print('{} {}\n{}'.format(A,B, 'A' if A>B or (A==B and l==1) else 'B' if A<B or (A==B and l==2) else 'D'))
[ 64, 11, 65, 11, 32, 11, 33, 11, 75, 28, 4868, 7, 8899, 7, 600, 11, 5128, 22446, 35312, 28955, 828, 1351, 7, 8899, 7, 600, 11, 5128, 22446, 35312, 28955, 828, 15, 11, 15, 11, 15, 198, 1640, 1312, 287, 2837, 7, 940, 2599, 357, ...
1.763975
161
# -*- coding: utf-8 -*-
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198 ]
1.434783
23
#!/usr/bin/env python # MiTuner_socket_server.py -- Python 2.7 socket server to be used with MiTuner Bridge # Copyright 2018 Microsemi Inc. All rights reserved. #Licensed under the MIT License. See LICENSE.txt in the project root for license information. from os.path import dirname, realpath, isfile import argpars...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 2, 13756, 51, 38886, 62, 44971, 62, 15388, 13, 9078, 220, 1377, 220, 11361, 362, 13, 22, 17802, 4382, 284, 307, 973, 351, 13756, 51, 38886, 10290, 198, 198, 2, 15069, 2864, 4527...
2.61779
1,439
import tensorflow as tf from .tf import TFDataset class TFCIFAR10(TFDataset): """`TFCIFAR10` class. Represents a CIFAR10 dataset class for TensorFlow. """ TF_MODULE = tf.keras.datasets.cifar10 DATASET_SIZE = {"train": 50000, "test": 10000} INPUT_SHAPE = (32, 32, 3) N_CLASSES = 10
[ 11748, 11192, 273, 11125, 355, 48700, 198, 198, 6738, 764, 27110, 1330, 24958, 27354, 292, 316, 628, 198, 4871, 309, 4851, 5064, 1503, 940, 7, 10234, 27354, 292, 316, 2599, 198, 220, 220, 220, 37227, 63, 51, 4851, 5064, 1503, 940, 63,...
2.258993
139
#!/usr/bin/env python # File name: name.py import sys import json import os import rsa import struct import json from block import * from controlblock import * base = [str(x) for x in range(10)] + [chr(x) for x in range(ord('A'), ord('A') + 6)] if __name__ == '__main__': print 'Signing Tool for the new Secure Boo...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 9220, 1438, 25, 1438, 13, 9078, 198, 11748, 25064, 198, 11748, 33918, 198, 11748, 28686, 198, 11748, 374, 11400, 198, 11748, 2878, 198, 11748, 33918, 198, 6738, 2512, 1330, 1635, 198,...
2.003538
2,261
#! /usr/bin/python # Copyright 2015 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. import argparse import cgi import json import logging import os import subprocess import sys import tempfile import time _SRC_DIR = os.pa...
[ 2, 0, 1220, 14629, 14, 8800, 14, 29412, 198, 2, 15069, 1853, 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, 28...
2.744456
1,984
import random class NaiveResourceManager(object): r""" Overview: the naive resource manager Interface: __init__, assign_collector, assign_learner, update """ def __init__(self) -> None: r""" Overview: init the resouce manager """ self._w...
[ 11748, 4738, 628, 198, 4871, 11013, 425, 26198, 13511, 7, 15252, 2599, 198, 220, 220, 220, 374, 37811, 198, 220, 220, 220, 28578, 25, 198, 220, 220, 220, 220, 220, 220, 220, 262, 24354, 8271, 4706, 198, 220, 220, 220, 26491, 25, 198...
2.314415
881
from rest_framework import serializers from .models import Ml_test #from .models import Account, Teleconference_transcribe from rest_framework import filters # class Teleconference_transcribeSerializer(serializers.HyperlinkedModelSerializer): # class Meta: # model = Teleconference_transcribe # fi...
[ 6738, 1334, 62, 30604, 1330, 11389, 11341, 198, 6738, 764, 27530, 1330, 337, 75, 62, 9288, 198, 2, 6738, 764, 27530, 1330, 10781, 11, 14318, 41124, 62, 7645, 66, 4892, 198, 198, 6738, 1334, 62, 30604, 1330, 16628, 628, 198, 2, 1398, ...
3.380531
113
from tkinter import * from tkinter import filedialog from tkinter.ttk import * import os import xlrd import xlsxwriter root = Tk() root.title("CivilCon") root.iconbitmap("CC.ico") root.geometry("500x500") e = CivilCon(root) root.mainloop()
[ 6738, 256, 74, 3849, 1330, 1635, 201, 198, 6738, 256, 74, 3849, 1330, 5717, 498, 519, 201, 198, 6738, 256, 74, 3849, 13, 926, 74, 1330, 1635, 201, 198, 11748, 28686, 201, 198, 11748, 2124, 75, 4372, 201, 198, 11748, 2124, 7278, 87, ...
2.247934
121
#!/usr/bin/env python3 # Copyright (C) 2016-2019 Semtech (International) AG. All rights reserved. # # This file is subject to the terms and conditions defined in file 'LICENSE', # which is part of this source code package. import os import shlex import sys import re import yaml from typing import Callable,Dict,List,...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 2, 15069, 357, 34, 8, 1584, 12, 23344, 12449, 13670, 357, 24274, 8, 13077, 13, 1439, 2489, 10395, 13, 198, 2, 198, 2, 770, 2393, 318, 2426, 284, 262, 2846, 290, 3403, 5447...
3.448276
145
import numpy as np import tensorflow as tf from tensorflow.keras import layers import matplotlib.pyplot as plt import math from tensorflow.keras.models import load_model from matplotlib import animation from env_predict import * from buffer import * from model import * from noise import * dt = 0.4 v = 1...
[ 11748, 299, 32152, 355, 45941, 201, 198, 11748, 11192, 273, 11125, 355, 48700, 201, 198, 6738, 11192, 273, 11125, 13, 6122, 292, 1330, 11685, 201, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 201, 198, 11748, 10688, 201...
2.13092
2,238
from ostinato.pages.views import PageView from django.views.generic.detail import DetailView from django.views.generic.dates import DateDetailView from ostinato.pages.models import Page from blog.models import Entry
[ 6738, 23619, 259, 5549, 13, 31126, 13, 33571, 1330, 7873, 7680, 198, 6738, 42625, 14208, 13, 33571, 13, 41357, 13, 49170, 1330, 42585, 7680, 198, 6738, 42625, 14208, 13, 33571, 13, 41357, 13, 19581, 1330, 7536, 11242, 603, 7680, 198, 19...
3.622951
61
"""Load article sample (1%) into spreadsheet for manual content analysis""" import pandas as pd import utils from question_1.is_about_climate_change_sql_statement import is_about_climate_change_sql_statement import os.path if __name__ == "__main__": main()
[ 37811, 8912, 2708, 6291, 357, 16, 4407, 656, 30117, 329, 10107, 2695, 3781, 37811, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 3384, 4487, 198, 6738, 1808, 62, 16, 13, 271, 62, 10755, 62, 42570, 62, 3803, 62, 25410, 62, 26090, ...
3.341772
79
import numpy from srxraylib.plot.gol import plot import scipy.constants as codata import xraylib if __name__ == "__main__": do_calculate_spectrum = True diamond_thickness_in_mm = 0.8 outfile = "spectrumE.dat" rho = 1.848 if do_calculate_spectrum: energy, flux = create_spectrum() ...
[ 11748, 299, 32152, 198, 6738, 19677, 87, 2433, 8019, 13, 29487, 13, 70, 349, 1330, 7110, 198, 11748, 629, 541, 88, 13, 9979, 1187, 355, 14873, 1045, 198, 11748, 2124, 2433, 8019, 628, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, ...
2.0726
2,135
import random import html from functools import cached_property from wyr.console import Console
[ 11748, 4738, 198, 11748, 27711, 198, 6738, 1257, 310, 10141, 1330, 39986, 62, 26745, 198, 6738, 266, 2417, 13, 41947, 1330, 24371, 628, 628 ]
4.125
24
import requests import math import pandas as pd from datetime import datetime from datetime import timedelta import requests interval = 1 symbol = 'XBTUSD' # get data from timestamp_from = 1514761200 # till timestamp_now = 1536530400 max_back_time = 0 max_bars = 10080 max_bars_time = ((interval * 60) * max_bars) tim...
[ 11748, 7007, 198, 11748, 10688, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 4818, 8079, 1330, 28805, 12514, 198, 198, 11748, 7007, 198, 3849, 2100, 796, 352, 198, 1837, 23650, 796, 705, 55, ...
2.361111
828
# Generated by Django 3.2.6 on 2021-08-05 22:52 from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 513, 13, 17, 13, 21, 319, 33448, 12, 2919, 12, 2713, 2534, 25, 4309, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.84375
32
# -*- coding: utf-8 -*- # A Variational Autoencoder trained on the MNIST dataset. import tensorflow as tf import keras import numpy as np import matplotlib.pyplot as plt from keras.layers import Input, Dense, Lambda, InputLayer, concatenate from keras.models import Model, Sequential from keras import backend as K from...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 317, 15965, 864, 5231, 6571, 66, 12342, 8776, 319, 262, 29060, 8808, 27039, 13, 198, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 41927, 292, 198, 11748, 29...
2.21573
4,005
from .beta_calibration import _BetaCal, _BetaAMCal, _BetaABCal from sklearn.base import BaseEstimator, RegressorMixin class BetaCalibration(BaseEstimator, RegressorMixin): """Wrapper class for the three Beta regression models introduced in Kull, M., Silva Filho, T.M. and Flach, P. Beta calibration: a well-fo...
[ 6738, 764, 31361, 62, 9948, 571, 1358, 1330, 4808, 43303, 9771, 11, 4808, 43303, 2390, 9771, 11, 4808, 43303, 24694, 282, 198, 6738, 1341, 35720, 13, 8692, 1330, 7308, 22362, 320, 1352, 11, 3310, 44292, 35608, 259, 628, 198, 4871, 17993...
2.505007
699
import numpy as np from feature_cost_model.action_cost import ActionCost
[ 11748, 299, 32152, 355, 45941, 198, 198, 6738, 3895, 62, 15805, 62, 19849, 13, 2673, 62, 15805, 1330, 7561, 13729, 628, 628, 198 ]
3.391304
23