content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
import asyncio from flask import ( abort, Blueprint, Response, render_template, request, current_app as app, ) # local imports from . import routes from luts import huc8_gdf huc_api = Blueprint("huc_api", __name__) @routes.route("/huc/") @routes.route("/huc/abstract/") @routes.route("/huc...
[ 11748, 30351, 952, 198, 6738, 42903, 1330, 357, 198, 220, 220, 220, 15614, 11, 198, 220, 220, 220, 39932, 11, 198, 220, 220, 220, 18261, 11, 198, 220, 220, 220, 8543, 62, 28243, 11, 198, 220, 220, 220, 2581, 11, 198, 220, 220, 220...
2.212209
344
# snapy - a python snmp library # # Copyright (C) 2009 ITA Software, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # version 2 as published by the Free Software Foundation. # # This program is distributed in the hope that it will be ...
[ 2, 11495, 88, 532, 257, 21015, 3013, 3149, 5888, 198, 2, 198, 2, 15069, 357, 34, 8, 3717, 314, 5603, 10442, 11, 3457, 13, 198, 2, 198, 2, 770, 1430, 318, 1479, 3788, 26, 345, 460, 17678, 4163, 340, 290, 14, 273, 198, 2, 13096, ...
3.632353
204
""" This tells Python that this is a module. """
[ 37811, 198, 1212, 4952, 11361, 326, 428, 318, 257, 8265, 13, 198, 37811, 198 ]
3.5
14
ACTION_TYPES = { 'INIT': '@@redux/INIT' } """ * Creates a Redux store that holds the state tree. * The only way to change the data in the store is to call `dispatch()` on it. * * There should only be a single store in your app. To specify how different * parts of the state tree respond to actions, you may combin...
[ 44710, 62, 9936, 47, 1546, 796, 1391, 198, 197, 6, 1268, 2043, 10354, 705, 12404, 445, 2821, 14, 1268, 2043, 6, 198, 92, 198, 198, 37811, 198, 1635, 7921, 274, 257, 30609, 3650, 326, 6622, 262, 1181, 5509, 13, 198, 1635, 383, 691, ...
3.777778
333
from warnings import filterwarnings from PIL import Image, ImageOps from jikanpy import Jikan from requests import get from time import sleep import re import os print('''Run this in your anime folder For help, info and memes, check out https://github.com/notdedsec/anicon ''') sleep(1) jikan = Jikan() filterwarnings(...
[ 6738, 14601, 1330, 8106, 40539, 654, 198, 6738, 350, 4146, 1330, 7412, 11, 7412, 41472, 198, 6738, 474, 49894, 9078, 1330, 449, 49894, 198, 6738, 7007, 1330, 651, 198, 6738, 640, 1330, 3993, 198, 11748, 302, 198, 11748, 28686, 198, 198,...
2.897527
849
# Generated by Django 2.2.1 on 2019-06-08 13:17 from django.db import migrations
[ 2, 2980, 515, 416, 37770, 362, 13, 17, 13, 16, 319, 13130, 12, 3312, 12, 2919, 1511, 25, 1558, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 628 ]
2.766667
30
# ---------------------------------------------------------------------- # # Brad T. Aagaard, U.S. Geological Survey # Charles A. Williams, GNS Science # Matthew G. Knepley, University at Buffalo # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http://geodynamics.org). # # Copy...
[ 2, 16529, 23031, 198, 2, 198, 2, 8114, 309, 13, 317, 8126, 446, 11, 471, 13, 50, 13, 34246, 13084, 198, 2, 7516, 317, 13, 6484, 11, 402, 8035, 5800, 198, 2, 9308, 402, 13, 6102, 538, 1636, 11, 2059, 379, 14905, 198, 2, 198, 2,...
2.840415
965
# A timer based LED chaser using adressable LEDs of type WS2812/NeoPixel # Tested on a an ESP32 running MicroPython import machine, neopixel from machine import Timer # Pin to use for controlling LEDs LED_STRIP_PIN = 14 # Number of LEDs on LED strip LED_STRIP_LENGTH = 42 # How many times a second (HZ) to advance the L...
[ 2, 317, 19781, 1912, 12365, 442, 6005, 1262, 512, 601, 540, 33697, 286, 2099, 25290, 2078, 1065, 14, 8199, 78, 40809, 198, 2, 6208, 276, 319, 257, 281, 9428, 2624, 2491, 4527, 37906, 198, 11748, 4572, 11, 497, 404, 7168, 198, 6738, ...
2.468541
747
#!/usr/bin/env python3 # ******************************************************** # # Project: ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 41906, 8412, 4557, 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, 22...
2.531915
1,175
from collections import defaultdict operMap = { '+' : 0, '-' : 1, '*' : 2, '/' : 3, '%' : 4, '=' : 5, '<' : 6, '>' : 7, '<=' : 8, ...
[ 6738, 17268, 1330, 4277, 11600, 198, 3575, 13912, 796, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 705, 10, 6, 220, 220, 220, 220, 220, 220, 220, 220, 1058, 657, 11, 198, 220, 220, 220, 220, 220, 220, 220, ...
1.706559
869
# # Copyright 2016 The BigDL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
[ 2, 198, 2, 15069, 1584, 383, 4403, 19260, 46665, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13...
2.317957
5,268
#!/usr/bin/env python # -*- encoding: utf-8 -*- import os import unittest from functional_tests.data.atlas.skulls.run import AtlasSkulls from functional_tests.data.atlas.brain_structures.run import AtlasBrainStructures from functional_tests.data.atlas.digits.run import AtlasDigits from functional_tests.data.regressio...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 21004, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 28686, 198, 11748, 555, 715, 395, 198, 198, 6738, 10345, 62, 41989, 13, 7890, 13, 265, 21921, 13, 8135, 7...
2.892216
167
class decoratorWithoutArguments(object): ''' If there are no decorator arguments, the function to be decorated is passed to the constructor. ''' ''' Note: 1. The major constraint on the result of a decorator is that it be callable. The __call__ method here achieves that. 2. __call...
[ 198, 4871, 11705, 1352, 16249, 28100, 2886, 7, 15252, 2599, 628, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 1002, 612, 389, 645, 11705, 1352, 7159, 11, 262, 2163, 284, 307, 24789, 318, 3804, 198, 220, 220, 220, 284, 262, 23772, 1...
2.814935
308
from .aitextgen import aitextgen from .TokenDataset import TokenDataset from .tokenizers import train_tokenizer import fire def aitextgen_cli(**kwargs): """Entrypoint for the CLI""" fire.Fire( { "encode": encode_cli, "train": train_cli, "generate": generate_cli, ...
[ 6738, 764, 64, 578, 742, 5235, 1330, 257, 578, 742, 5235, 198, 6738, 764, 30642, 27354, 292, 316, 1330, 29130, 27354, 292, 316, 198, 6738, 764, 30001, 11341, 1330, 4512, 62, 30001, 7509, 198, 11748, 2046, 628, 198, 4299, 257, 578, 742...
2.34004
497
from LRL_main_arena.envs.LaRoboLiga_main import LaRoboLigaPs2Arena
[ 6738, 406, 7836, 62, 12417, 62, 533, 2616, 13, 268, 14259, 13, 14772, 14350, 78, 43, 13827, 62, 12417, 1330, 4689, 14350, 78, 43, 13827, 12016, 17, 43199, 64 ]
2.275862
29
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE from __future__ import absolute_import import pytest import uproot @pytest.mark.network @pytest.mark.network @pytest.mark.network
[ 2, 347, 10305, 513, 12, 2601, 682, 13789, 26, 766, 3740, 1378, 12567, 13, 785, 14, 36216, 15813, 12, 258, 79, 14, 929, 15763, 19, 14, 2436, 672, 14, 12417, 14, 43, 2149, 24290, 198, 198, 6738, 11593, 37443, 834, 1330, 4112, 62, 11...
2.719512
82
import numpy as np module_masses = load_inputs("input.txt") module_fuels = map(get_fuel_v2, module_masses) total = sum(module_fuels) print("Total: ", total)
[ 11748, 299, 32152, 355, 45941, 198, 198, 21412, 62, 76, 13978, 796, 3440, 62, 15414, 82, 7203, 15414, 13, 14116, 4943, 198, 21412, 62, 20942, 1424, 796, 3975, 7, 1136, 62, 25802, 62, 85, 17, 11, 8265, 62, 76, 13978, 8, 198, 23350, ...
2.633333
60
#!/Users/sunyun/anaconda3/bin/python import sys import time import utils sys.path.append("/Users/sunyun/software/python") if __name__ == "__main__": team = Team("MRE") team.add_member("Caroline", "McQuatt") team.add_member("Dmitry", "Serpakov") team.add_member("James", "Roland") team.add_mem...
[ 2, 48443, 14490, 14, 19155, 88, 403, 14, 272, 330, 13533, 18, 14, 8800, 14, 29412, 198, 198, 11748, 25064, 198, 11748, 640, 198, 11748, 3384, 4487, 198, 198, 17597, 13, 6978, 13, 33295, 7203, 14, 14490, 14, 19155, 88, 403, 14, 43776...
2.226339
2,483
import numpy as np from sklearn.base import BaseEstimator def scaled_linspace(x: np.ndarray, y: np.ndarray, num: int, scaler: BaseEstimator) -> np.ndarray: """Generate a linspace, evenly spaced according to the normalization Args: x (np.ndarray): First point y (np.ndarray): Sencon...
[ 11748, 299, 32152, 355, 45941, 198, 6738, 1341, 35720, 13, 8692, 1330, 7308, 22362, 320, 1352, 628, 198, 4299, 27464, 62, 21602, 10223, 7, 87, 25, 45941, 13, 358, 18747, 11, 331, 25, 45941, 13, 358, 18747, 11, 997, 25, 493, 11, 1657...
2.430769
325
from keras_classifiers import ffn1, ffn2, cnn1, cnn2, train_and_evaluate from sklearn_classifiers import train_and_evaluate_all import utils as u print('\n\nEvaluating DNN Classifiers') # train_and_evaluate(cnn1, u.FEATURE_SET_SPECS) # train_and_evaluate(cnn2, u.FEATURE_SET_SPECS) # train_and_evaluate(ffn1, u.FEATURE...
[ 6738, 41927, 292, 62, 4871, 13350, 1330, 277, 22184, 16, 11, 277, 22184, 17, 11, 269, 20471, 16, 11, 269, 20471, 17, 11, 4512, 62, 392, 62, 49786, 198, 6738, 1341, 35720, 62, 4871, 13350, 1330, 4512, 62, 392, 62, 49786, 62, 439, 1...
2.433962
212
# Generated by Django 2.0.2 on 2018-03-01 22:33 from django.db import migrations, models import django.utils.timezone
[ 2, 2980, 515, 416, 37770, 362, 13, 15, 13, 17, 319, 2864, 12, 3070, 12, 486, 2534, 25, 2091, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 198, 11748, 42625, 14208, 13, 26791, 13, 2435, 11340, 628 ]
2.926829
41
# Copyright 2019 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
[ 2, 15069, 13130, 3012, 11419, 13, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, ...
3.554585
458
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # 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 ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 16529, 26171, 198, 2, 198, 2, 220, 220, 15069, 2864, 12, 23344, 376, 7569, 13, 20185, 15302, 198, 2, 198, 2, 220, 220, 49962, 739, 262, 24843, 13789, 11, 10628, 3...
2.189468
9,590
import algorithm_rgb as al import os import osgeo.gdal as gdal import numpy as np import json input1 = './test_input/rgb_1_2_E.tif' input2 = './test_input/rgb_40_11_W.tif' meta = './meta.json' # -------------------------------------------------- def test_input_files(): """Test input files exist""" assert os...
[ 11748, 11862, 62, 81, 22296, 355, 435, 198, 11748, 28686, 198, 11748, 28686, 469, 78, 13, 21287, 282, 355, 308, 31748, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 33918, 198, 198, 15414, 16, 796, 705, 19571, 9288, 62, 15414, 14, 8...
2.768506
1,486
from cnn_classifier_stepwise.base.cnn_classifier_stepwise_base import \ CnnStepwiseClassifierBaseDf from self_supervised.network.flatten_mlp import FlattenMlpDropout
[ 6738, 269, 20471, 62, 4871, 7483, 62, 9662, 3083, 13, 8692, 13, 66, 20471, 62, 4871, 7483, 62, 9662, 3083, 62, 8692, 1330, 3467, 198, 220, 220, 220, 327, 20471, 8600, 3083, 9487, 7483, 14881, 35, 69, 198, 198, 6738, 2116, 62, 16668,...
2.85
60
import Bio,gzip from Bio import SeqIO import pyteomics from pyteomics import mass,fasta import pyteomics.parser as pyt_parser import pandas as pd import numpy as np import json,os from tqdm import tqdm from load_config import CONFIG MAX_DATABASE_SIZE=100000000 DB_PEPTIDE_MINIMUM_LENGTH=CONFIG['DB_PEPTIDE_MINIMUM_LENG...
[ 11748, 16024, 11, 70, 13344, 198, 6738, 16024, 1330, 1001, 80, 9399, 198, 11748, 12972, 660, 31994, 198, 6738, 12972, 660, 31994, 1330, 2347, 11, 7217, 64, 198, 11748, 12972, 660, 31994, 13, 48610, 355, 12972, 83, 62, 48610, 198, 11748,...
2.257062
354
#!/usr/bin/env python ''' Python and Ansible for Network Engineers Week 2, Exercise 2 Write a script that connects using telnet to the pynet-rtr1 router. Execute the 'show ip int brief' command on the router and return the output. ''' import telnetlib import time import sys TELNET_PORT = 23 TELNET_TIMEOUT = 6 ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 7061, 6, 198, 37906, 290, 28038, 856, 329, 7311, 27170, 198, 20916, 362, 11, 32900, 362, 198, 198, 16594, 257, 4226, 326, 20417, 1262, 13632, 3262, 284, 262, 279, 2047, 316, 12, 81, ...
2.582386
352
import sys import time import random from menu import Menu from game_engine import Console, Player console = Console() player = Player() start = True basement_suprise = ["demon", "open", "closed", "bear"] sus_building = ["enemy_trap", "human_traffic", "smuggler"] boat_stuff = ["tip over", "fight", "safe"] truck_surviv...
[ 11748, 25064, 198, 11748, 640, 198, 11748, 4738, 198, 6738, 6859, 1330, 21860, 198, 6738, 983, 62, 18392, 1330, 24371, 11, 7853, 198, 198, 41947, 796, 24371, 3419, 198, 7829, 796, 7853, 3419, 198, 9688, 796, 6407, 198, 12093, 972, 62, ...
4.776908
511
#!/usr/bin/python import MySQLdb import serial import time try: con = _mysql.connect('localhost', 'sms_gat', 'sms_gat', 'sms_gateway') con.query("SELECT VERSION()") result = con.use_result() print "MySQL version: %s" % \ result.fetch_row()[0] except _mysql.Error, e: ...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 628, 198, 11748, 33476, 9945, 198, 11748, 11389, 198, 11748, 640, 628, 628, 198, 28311, 25, 198, 220, 220, 220, 369, 796, 4808, 28744, 13976, 13, 8443, 10786, 36750, 3256, 705, 82, 907, 62, 41268,...
2.395
400
""" Example scenario for wartime negotiation. Provides use cases for both modeling and simulating scenarios. """ import sys from ConfigParser import SafeConfigParser from argparse import ArgumentParser import StringIO from psychsim.pwl import * from psychsim.reward import * from psychsim.action import * from psychsim....
[ 37811, 198, 16281, 8883, 329, 35382, 24462, 13, 198, 15946, 1460, 779, 2663, 329, 1111, 21128, 290, 985, 8306, 13858, 13, 198, 37811, 198, 11748, 25064, 198, 6738, 17056, 46677, 1330, 19978, 16934, 46677, 198, 6738, 1822, 29572, 1330, 457...
2.247907
17,442
""" Author: mcncm, 2019 Standard output messages for displaying hierarchically-organized data such as recursively-called status lines. """ import os import sys import datetime as dt from functools import wraps import getpass import inspect from io import StringIO import logging import platform import textwrap import ...
[ 37811, 198, 13838, 25, 36650, 10782, 76, 11, 13130, 198, 23615, 5072, 6218, 329, 19407, 28398, 1146, 12, 30280, 1366, 884, 355, 198, 8344, 1834, 2280, 12, 7174, 3722, 3951, 13, 198, 37811, 198, 198, 11748, 28686, 198, 11748, 25064, 198,...
2.477655
3,088
""" Make sure that the correct versions of gobject introspection dependencies are installed. """ import os import logging from gi import require_version from .locale import _ require_version('Gio', '2.0') require_version('GLib', '2.0') _in_X = bool(os.environ.get('DISPLAY')) _has_Gtk = (3 if check_version('Gtk...
[ 37811, 198, 12050, 1654, 326, 262, 3376, 6300, 286, 48484, 752, 18951, 31308, 20086, 198, 533, 6589, 13, 198, 37811, 198, 198, 11748, 28686, 198, 11748, 18931, 198, 198, 6738, 308, 72, 1330, 2421, 62, 9641, 198, 198, 6738, 764, 17946, ...
2.579365
504
import dj_database_url from decouple import config from .base import * # noqa SECRET_KEY = 'django-insecure-ibi@xb(j2k@r&%*(*&(^%$%^$%^^&)))5_niq9erpkv%*!&!m9hp' DEBUG = True ALLOWED_HOSTS = [] DATABASES = { 'default': dj_database_url.config(default=config('SQLITE_DB')) }
[ 11748, 42625, 62, 48806, 62, 6371, 198, 6738, 875, 43846, 1330, 4566, 198, 6738, 764, 8692, 1330, 1635, 220, 1303, 645, 20402, 198, 198, 23683, 26087, 62, 20373, 796, 705, 28241, 14208, 12, 259, 22390, 12, 27567, 31, 30894, 7, 73, 17,...
2.153846
130
# nlantau, 2020-12-15 import copy import os # STARTING_NUMBERS = [2, 0, 6, 12, 1, 3] STARTING_NUMBERS = [0, 3, 6] if __name__ == "__main__": main()
[ 2, 299, 75, 415, 559, 11, 12131, 12, 1065, 12, 1314, 198, 11748, 4866, 198, 11748, 28686, 198, 198, 2, 33303, 2751, 62, 41359, 33, 4877, 796, 685, 17, 11, 657, 11, 718, 11, 1105, 11, 352, 11, 513, 60, 198, 2257, 7227, 2751, 62, ...
2.065789
76
from random_utils import from_dungeon_level
[ 6738, 4738, 62, 26791, 1330, 422, 62, 67, 403, 6281, 62, 5715, 628 ]
3.461538
13
# Given a string, return the count of the number of times that a substring # length 2 appears in the string and also as the last 2 chars of the string, # so "hixxxhi" yields 1 (we won't count the end substring). # last2('hixxhi') --> 1 # last2('xaxxaxaxx') --> 1 # last2('axxxaaxx') --> 2 print(last2('hixxhi')) print...
[ 2, 11259, 257, 4731, 11, 1441, 262, 954, 286, 262, 1271, 286, 1661, 326, 257, 3293, 1806, 198, 2, 4129, 362, 3568, 287, 262, 4731, 290, 635, 355, 262, 938, 362, 34534, 286, 262, 4731, 11, 198, 2, 523, 366, 71, 844, 5324, 5303, 1...
2.633094
139
from config import * from gdocument import GDocument if __name__ == '__main__': main()
[ 6738, 4566, 1330, 1635, 198, 6738, 308, 22897, 1330, 402, 24941, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1388, 3419, 198 ]
3.032258
31
''' Created on 17.10.2019 @author: JM ''' class TMC2225_register_variant: " ===== TMC2225 register variants ===== " "..."
[ 7061, 6, 198, 41972, 319, 1596, 13, 940, 13, 23344, 198, 198, 31, 9800, 25, 47726, 198, 7061, 6, 198, 198, 4871, 309, 9655, 1828, 1495, 62, 30238, 62, 25641, 415, 25, 628, 220, 220, 220, 366, 29335, 309, 9655, 1828, 1495, 7881, 17...
2.538462
52
import datetime import unittest import pytest from src.info_string import this_year_info_string
[ 11748, 4818, 8079, 198, 11748, 555, 715, 395, 198, 198, 11748, 12972, 9288, 198, 198, 6738, 12351, 13, 10951, 62, 8841, 1330, 428, 62, 1941, 62, 10951, 62, 8841, 198 ]
3.266667
30
import sys import PyQt5 from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5 import uic from pprint import pprint import cv2 as cv Calui ='./ui.ui' if __name__ =='__main__': app = QApplication(sys.argv) main_dialog=MainDialog() main_dialog.show() app.exec_...
[ 11748, 25064, 198, 198, 11748, 9485, 48, 83, 20, 198, 6738, 9485, 48, 83, 20, 13, 48, 83, 8205, 72, 1330, 1635, 198, 6738, 9485, 48, 83, 20, 13, 48, 83, 14055, 1330, 1635, 198, 6738, 9485, 48, 83, 20, 13, 48, 83, 54, 312, 1140...
2.194805
154
from enum import Enum from sklearn.svm import SVC from sklearn.tree import DecisionTreeClassifier from sklearn.naive_bayes import GaussianNB from sklearn.neighbors import KNeighborsClassifier from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier from sklearn.discriminant_analysis import Quadrati...
[ 6738, 33829, 1330, 2039, 388, 201, 198, 6738, 1341, 35720, 13, 82, 14761, 1330, 311, 15922, 201, 198, 6738, 1341, 35720, 13, 21048, 1330, 26423, 27660, 9487, 7483, 201, 198, 6738, 1341, 35720, 13, 2616, 425, 62, 24406, 274, 1330, 12822,...
3.410714
168
from utils.api_tools import * from recommends.douban_top250 import DoubanTop class DoubanTopAPI(Resource): """ 获取豆瓣读书 Top250 数据 """ args_get = reqparse.RequestParser() \ .add_argument("page", help="分页", type=int, required=False, location=["args", ]) @args_required_method(args_get)
[ 6738, 3384, 4487, 13, 15042, 62, 31391, 1330, 1635, 198, 6738, 20829, 13, 67, 280, 3820, 62, 4852, 9031, 1330, 5728, 3820, 9126, 628, 198, 4871, 5728, 3820, 9126, 17614, 7, 26198, 2599, 198, 220, 220, 220, 37227, 198, 220, 220, 220, ...
2.268116
138
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-11-03 06:28 from __future__ import unicode_literals from django.db import migrations, models
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2980, 515, 416, 37770, 352, 13, 940, 319, 1584, 12, 1157, 12, 3070, 9130, 25, 2078, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 198, 6738,...
2.8
55
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2018 Matthew Stone <mstone5@mgh.harvard.edu> # Distributed under terms of the MIT license. """ """ import argparse import heapq from collections import deque import pysam import svtk.utils as svu def records_match(record, other): """ Test if two ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 15069, 10673, 2864, 9308, 8026, 1279, 76, 6440, 20, 31, 76, 456, 13, 9869, 10187, 13, 15532, 29, 198, 2,...
2.539672
1,525
#!/usr/bin/python -S """ formatters.py This module should implement the standard list of formatters. It also provides a method LookupChain for *composing lookup chains* for formatters. Formatter lookup chaining is not to be confused with plain formatter chaining, e.g.: {variable|html|json} If anyone has any bett...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 532, 50, 198, 37811, 198, 18982, 1010, 13, 9078, 198, 198, 1212, 8265, 815, 3494, 262, 3210, 1351, 286, 5794, 1010, 13, 198, 198, 1026, 635, 3769, 257, 2446, 6803, 929, 35491, 329, 1635, 785, 32...
3.211907
991
from codecs import open from ohoh import build_parser, DEFAULT_HOST, DEFAULT_PORT from os import path import os import pytest import sys import time @pytest.fixture @pytest.fixture @pytest.fixture @pytest.mark.parametrize("address,expected", [ (None, (DEFAULT_HOST, DEFAULT_PORT)), ("localhost", ("localhost"...
[ 6738, 40481, 82, 1330, 1280, 198, 6738, 11752, 1219, 1330, 1382, 62, 48610, 11, 5550, 38865, 62, 39, 10892, 11, 5550, 38865, 62, 15490, 198, 6738, 28686, 1330, 3108, 198, 11748, 28686, 198, 11748, 12972, 9288, 198, 11748, 25064, 198, 11...
2.698925
186
from pygame.surface import Surface import constants from font import Font from root_object.circle import Circle from root_object.text import Text
[ 6738, 12972, 6057, 13, 42029, 1330, 20321, 198, 198, 11748, 38491, 198, 6738, 10369, 1330, 24060, 198, 6738, 6808, 62, 15252, 13, 45597, 1330, 16291, 198, 6738, 6808, 62, 15252, 13, 5239, 1330, 8255, 628 ]
4.228571
35
import os import glob import yaml
[ 11748, 28686, 198, 11748, 15095, 198, 11748, 331, 43695, 198 ]
3.4
10
# Copyright 2021 Adobe. All rights reserved. # This file is licensed to you 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 la...
[ 2, 15069, 33448, 21771, 13, 1439, 2489, 10395, 13, 198, 2, 770, 2393, 318, 11971, 284, 345, 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, ...
3.902954
237
import snap import numpy as np G = snap.PNGraph.New() for i in range(6): G.AddNode(i) G.AddEdge(0, 1) G.AddEdge(1, 2) G.AddEdge(2, 0) G.AddEdge(3, 4) G.AddEdge(4, 5) G.AddEdge(5, 3) G.AddEdge(4, 3) G.AddEdge(5, 4) G.AddEdge(3, 5) out_file = '../data/small.txt' print 'data:', out_file snap.SaveEdgeList(G, out_fi...
[ 11748, 11495, 198, 11748, 299, 32152, 355, 45941, 198, 198, 38, 796, 11495, 13, 47, 10503, 1470, 13, 3791, 3419, 198, 1640, 1312, 287, 2837, 7, 21, 2599, 198, 220, 220, 220, 402, 13, 4550, 19667, 7, 72, 8, 198, 198, 38, 13, 4550, ...
1.928571
168
import os import toml def _or(val_a, val_b, default=None): """ Used to allow specifying config values through os.environ Args: val_a: val_b: """ if val_a is not None: return val_a elif val_b is not None: return val_b else: return default
[ 11748, 28686, 198, 198, 11748, 284, 4029, 198, 198, 4299, 4808, 273, 7, 2100, 62, 64, 11, 1188, 62, 65, 11, 4277, 28, 14202, 2599, 198, 220, 220, 220, 37227, 16718, 284, 1249, 31577, 4566, 3815, 832, 198, 220, 220, 220, 28686, 13, ...
2.101351
148
from pydantic import BaseModel from typing import List from .notification_model import Notification
[ 6738, 279, 5173, 5109, 1330, 7308, 17633, 198, 6738, 19720, 1330, 7343, 198, 198, 6738, 764, 1662, 2649, 62, 19849, 1330, 42808, 198 ]
4.391304
23
import json from dataclasses import dataclass from spatula import ( HtmlPage, XmlPage, JsonPage, CsvListPage, HtmlListPage, XmlListPage, JsonListPage, XPath, URL, ) SOURCE = "https://example.com" @dataclass
[ 11748, 33918, 198, 6738, 4818, 330, 28958, 1330, 4818, 330, 31172, 198, 6738, 15246, 4712, 1330, 357, 198, 220, 220, 220, 367, 20369, 9876, 11, 198, 220, 220, 220, 1395, 4029, 9876, 11, 198, 220, 220, 220, 449, 1559, 9876, 11, 198, ...
2.238938
113
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
[ 2, 16529, 1783, 10541, 198, 2, 15069, 357, 66, 8, 5413, 10501, 13, 1439, 2489, 10395, 13, 198, 2, 49962, 739, 262, 17168, 13789, 13, 4091, 13789, 13, 14116, 287, 262, 1628, 6808, 329, 5964, 1321, 13, 198, 2, 16529, 1783, 10541, 198,...
4.786885
122
# Shows top posters and percentage of posts from top posters for the # last 14 days. You need recent data to run this. # # Run this with ./manage.py runscript run_contributor_counts.py from collections import defaultdict from datetime import datetime, timedelta from kitsune.forums.models import Post if __name__ =...
[ 2, 25156, 1353, 19379, 290, 5873, 286, 6851, 422, 1353, 19379, 329, 262, 198, 2, 938, 1478, 1528, 13, 921, 761, 2274, 1366, 284, 1057, 428, 13, 198, 2, 198, 2, 5660, 428, 351, 24457, 805, 496, 13, 9078, 1057, 12048, 1057, 62, 3642...
3.491228
114
# -*- coding: utf-8 -*- import json, logging log = logging.getLogger(__name__) def parse_query( request ): """ Preps and returns three data-elements. Called by views.reconcile_v2() """ ( query, query_type, callback ) = ( request.POST.get('query', None), request.POST.get('query_type', None), request...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 33918, 11, 18931, 628, 198, 6404, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 628, 198, 4299, 21136, 62, 22766, 7, 2581, 15179, 198, 220, 220,...
2.453211
545
from setuptools import setup, find_packages setup( name="koala", version='0.0', description='Topological Amorphous quantum system simulations', long_description='', author="Peru D'Ornellas, Gino Cassella, Tom Hodson", author_email='', license='Apache Software License', home_page='', ...
[ 6738, 900, 37623, 10141, 1330, 9058, 11, 1064, 62, 43789, 198, 198, 40406, 7, 198, 220, 220, 220, 1438, 2625, 7204, 6081, 1600, 198, 220, 220, 220, 2196, 11639, 15, 13, 15, 3256, 198, 220, 220, 220, 6764, 11639, 9126, 2770, 1703, 13...
2.182432
296
import numpy as np
[ 11748, 299, 32152, 355, 45941, 198 ]
3.166667
6
# testPhiGradx.py # test the grad wrt x returned by trHess when nTh > 2 import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt from src.Phi import * import torch.nn.utils doPlots = True d = 2 m = 5 nTh = 4 net = Phi(nTh=nTh, m=m, d=d) net.double() # vecParams = nn.utils.convert_parameters.parame...
[ 2, 1332, 2725, 72, 42731, 87, 13, 9078, 198, 2, 1332, 262, 3915, 1319, 83, 2124, 4504, 416, 491, 39, 408, 618, 299, 817, 1875, 362, 198, 198, 11748, 2603, 29487, 8019, 198, 6759, 29487, 8019, 13, 1904, 10786, 51, 74, 46384, 11537, ...
2.12334
527
import os import torch import CubeNet.net import CubeNet.Picker import CubeNet.config network = CubeNet.net.UNet(); network.load_state_dict(torch.load(os.path.join(os.path.split(CubeNet.__file__)[0],'Para.pt'))); picker = CubeNet.Picker.IrrPicker(arr_info=CubeNet.config.arr_info, para...
[ 11748, 28686, 198, 11748, 28034, 198, 11748, 23315, 7934, 13, 3262, 198, 11748, 23315, 7934, 13, 47, 15799, 198, 11748, 23315, 7934, 13, 11250, 198, 198, 27349, 796, 23315, 7934, 13, 3262, 13, 4944, 316, 9783, 3127, 13, 2220, 62, 5219, ...
1.96129
310
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2019 Lorenzo 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 Software without restriction, including without limitation the rights to use, ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 37811, 198, 464, 17168, 13789, 357, 36393, 8, 198, 198, 15269, 357, 66, 8, 13130, 41721, 198, 198, 5990, 3411, 318, 29376, 7520, 11, 1479, 286, 3877, 11, 284, 597...
2.853342
3,157
#!/usr/bin/env python # coding: utf-8 # In[8]: import numpy as np import matplotlib.pyplot as plt import seaborn as sns; sns.set() ranstat = np.random.RandomState(1) P = np.dot(ranstat.rand(2, 2), ranstat.randn(2, 600)).T plt.scatter(P[:, 0], P[:, 1]) plt.axis('equal'); # In[ ]: # In[ ]:
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 2, 554, 58, 23, 5974, 628, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 3...
2.163121
141
from typing import Optional from functools import wraps from io import StringIO from sh import RunningCommand from requests.exceptions import ConnectionError, HTTPError from firepy.connection import Connection from firepy.exceptions import err_from_stderr, FirecrackerApiError from firepy.utils.network_utils import netw...
[ 6738, 19720, 1330, 32233, 198, 6738, 1257, 310, 10141, 1330, 27521, 198, 6738, 33245, 1330, 10903, 9399, 198, 6738, 427, 1330, 18162, 21575, 198, 6738, 7007, 13, 1069, 11755, 1330, 26923, 12331, 11, 14626, 12331, 198, 6738, 2046, 9078, 13...
3.494737
190
import datetime import json import logging from collections import OrderedDict from typing import List, Any, Dict import guacamol from guacamol.goal_directed_benchmark import GoalDirectedBenchmark, GoalDirectedBenchmarkResult from guacamol.goal_directed_generator import GoalDirectedGenerator from guacamol.benchmark_su...
[ 11748, 4818, 8079, 198, 11748, 33918, 198, 11748, 18931, 198, 6738, 17268, 1330, 14230, 1068, 35, 713, 198, 6738, 19720, 1330, 7343, 11, 4377, 11, 360, 713, 198, 198, 11748, 915, 330, 321, 349, 198, 6738, 915, 330, 321, 349, 13, 35231...
2.703993
1,152
#!/usr/bin/env python3 # Copyright (C) 2017 Roland Lutz # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 15069, 357, 34, 8, 2177, 220, 29761, 406, 27839, 198, 2, 198, 2, 2448, 3411, 284, 779, 11, 4866, 11, 13096, 11, 290, 14, 273, 14983, 428, 3788, 329, 597, 198, 2, 4007, 351...
2.642674
1,556
import time import numpy as np from remio import MJPEGEncoder encoderParams = { "quality": 60, "colorspace": "bgr", "colorsubsampling": "422", "fastdct": True, } def test_encoder(): """Test socket encoder class.""" max_encoding_time = 0.02 # seconds encoder = MJPEGEncoder(**encoderPara...
[ 11748, 640, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 816, 952, 1330, 337, 12889, 7156, 27195, 12342, 628, 198, 12685, 12342, 10044, 4105, 796, 1391, 198, 220, 220, 220, 366, 13237, 1298, 3126, 11, 198, 220, 220, 220, 366, 4033, ...
2.351064
282
# Python Class 2344 # Lesson 10 Problem 1 # Author: snowapple (471208) import random from tkinter import * import tkinter.messagebox as messagebox play_minesweeper(12, 10, 15)
[ 2, 11361, 5016, 2242, 2598, 198, 2, 12892, 261, 838, 20647, 352, 198, 2, 6434, 25, 6729, 18040, 357, 2857, 1065, 2919, 8, 198, 198, 11748, 4738, 198, 6738, 256, 74, 3849, 1330, 1635, 198, 11748, 256, 74, 3849, 13, 20500, 3524, 355, ...
2.904762
63
# Generated by Django 4.0.1 on 2022-01-12 15:28 import django.db.models.deletion from django.conf import settings from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 604, 13, 15, 13, 16, 319, 33160, 12, 486, 12, 1065, 1315, 25, 2078, 198, 198, 11748, 42625, 14208, 13, 9945, 13, 27530, 13, 2934, 1616, 295, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625,...
3.019231
52
''' Extract all the 6 training zipped files and 2 validation zipped files into data folder and then run this script ''' import cv2 import numpy as np import os import zipfile ## Runnin a loop throught all the zipped training file to extract all video and then extract 100 frames from each. for i in range(1,76): if ...
[ 7061, 6, 198, 11627, 974, 477, 262, 718, 3047, 1976, 3949, 3696, 290, 362, 21201, 1976, 3949, 3696, 656, 1366, 9483, 290, 788, 1057, 428, 4226, 198, 7061, 6, 198, 11748, 269, 85, 17, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2...
2.259521
1,838
import pandas as pd import matplotlib.pyplot as plt import glob, os aos_data = pd.read_csv("aos.csv") soa_data = pd.read_csv("soa.csv") plt.loglog(aos_data["n"],aos_data["time"],"o",markersize=1,label="aos") plt.loglog(soa_data["n"],soa_data["time"],"o",markersize=1,label="soa") plt.title("aos vs soa") plt.legend() plt...
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 15095, 11, 28686, 198, 7495, 62, 7890, 796, 279, 67, 13, 961, 62, 40664, 7203, 7495, 13, 40664, 4943, 198, 568, 64, 62, 7890,...
2.183333
180
try: import pypissh except: print "WARNING: not using PyPi over SSH!" import sys import os import shutil import re from setuptools import setup ## can't just naively import these from txtorcon, as that will only ## work if you already installed the dependencies :( __version__ = '0.13.0' __author__ = 'meejah' _...
[ 28311, 25, 198, 220, 220, 220, 1330, 279, 4464, 747, 71, 198, 16341, 25, 198, 220, 220, 220, 3601, 366, 31502, 25, 407, 1262, 9485, 38729, 625, 33825, 2474, 198, 11748, 25064, 198, 11748, 28686, 198, 11748, 4423, 346, 198, 11748, 302,...
2.323963
1,494
# This sample tests the reportUnusedVariable diagnostic check.
[ 2, 770, 6291, 5254, 262, 989, 3118, 1484, 43015, 23584, 2198, 13, 628 ]
4.923077
13
# Imports import matplotlib.pyplot as plt import seaborn as sns import torch from torch import nn from torch import optim import torch.nn.functional as F from torchvision import datasets, transforms, models from PIL import Image import numpy as np import json import pandas as pd # Import for keeping our session aliv...
[ 2, 1846, 3742, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 384, 397, 1211, 355, 3013, 82, 198, 198, 11748, 28034, 198, 6738, 28034, 1330, 299, 77, 198, 6738, 28034, 1330, 6436, 198, 11748, 28034, 13, 2047...
2.42765
1,396
from django.urls import path from user.views import ProfileView,ProfileEditView,AllProfilesView from django.contrib.auth.decorators import login_required urlpatterns = [ # dynamic URL path('in/<str:username>/',login_required(ProfileView.as_view()),name='profile_view'), path('in/<str:username>/edit/',login_...
[ 6738, 42625, 14208, 13, 6371, 82, 1330, 3108, 198, 6738, 2836, 13, 33571, 1330, 13118, 7680, 11, 37046, 18378, 7680, 11, 3237, 15404, 2915, 7680, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 12501, 273, 2024, 1330, 17594, 62, ...
2.824561
171
union_examples = """ Examples ----------- >>> import pandas as pd >>> import piso.interval >>> piso.interval.union( ... pd.Interval(0, 3), ... pd.Interval(2, 4), ... ) Interval(0.0, 4.0, closed='right') >>> piso.interval.union( ... pd.Interval(0, 3), ... pd.Interval(2, 4), ... squeeze=False, ... ) <In...
[ 24592, 62, 1069, 12629, 796, 37227, 198, 27730, 198, 32284, 198, 198, 33409, 1330, 19798, 292, 355, 279, 67, 198, 33409, 1330, 279, 26786, 13, 3849, 2100, 198, 198, 33409, 279, 26786, 13, 3849, 2100, 13, 24592, 7, 198, 986, 220, 220, ...
2.382087
2,434
__example_payload__ = "SELECT * FROM information_schema.tables" __type__ = "encoding all characters in the payload into their URL encoding equivalent"
[ 834, 20688, 62, 15577, 2220, 834, 796, 366, 46506, 1635, 16034, 1321, 62, 15952, 2611, 13, 83, 2977, 1, 198, 834, 4906, 834, 796, 366, 12685, 7656, 477, 3435, 287, 262, 21437, 656, 511, 10289, 21004, 7548, 1, 628 ]
3.897436
39
# flake8: noqa # These have to be synced with the stdlib.pxi import asyncio import collections import concurrent.futures import errno import functools import gc import inspect import itertools import os import signal import socket import subprocess import ssl import stat import sys import threading import traceback im...
[ 2, 781, 539, 23, 25, 645, 20402, 198, 198, 2, 2312, 423, 284, 307, 6171, 771, 351, 262, 14367, 8019, 13, 8416, 72, 198, 11748, 30351, 952, 198, 11748, 17268, 198, 11748, 24580, 13, 69, 315, 942, 198, 11748, 11454, 3919, 198, 11748, ...
3.61
100
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/import_test_package/import_public.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf i...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2980, 515, 416, 262, 8435, 11876, 17050, 13, 220, 8410, 5626, 48483, 0, 198, 2, 2723, 25, 23645, 14, 11235, 672, 3046, 14, 32538, 14, 11748, 62, 9288, 62, 26495, ...
2.946043
556
""" CONSOLE LOGGING VERBOSITY LEVELS --------------------------------- 0 - FATAL 1 - CRITICAL 2 - INFO 3 - LOUD 4 - DEBUG """ from __future__ import print_function VERBOSITY = 3 # Pass a function that handles printing
[ 37811, 198, 10943, 15821, 2538, 41605, 38, 2751, 33310, 33, 2640, 9050, 49277, 50, 198, 3880, 12, 198, 15, 532, 47200, 1847, 198, 16, 532, 8740, 2043, 20151, 198, 17, 532, 24890, 198, 18, 532, 406, 2606, 35, 198, 19, 532, 16959, 198...
3.097222
72
#!/usr/bin/env python3 import multiprocessing as mp import functools import logging import time from typing import List from tqdm.auto import tqdm from dataclasses import dataclass from simple_parsing import Serializable from pathlib import Path from google.cloud import storage from top.data.objectron_detection impo...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 18540, 305, 919, 278, 355, 29034, 198, 11748, 1257, 310, 10141, 198, 11748, 18931, 198, 11748, 640, 198, 198, 6738, 19720, 1330, 7343, 198, 6738, 256, 80, 36020, 13, 23...
2.760773
673
import doctest import os import pytest import psyneulink as pnl
[ 11748, 10412, 395, 198, 198, 11748, 28686, 198, 11748, 12972, 9288, 198, 198, 11748, 17331, 710, 377, 676, 355, 279, 21283, 628, 628, 198 ]
2.916667
24
import pandas as pd import re from keras.models import Sequential from keras.layers import Dense from keras.wrappers.scikit_learn import KerasRegressor from sklearn.preprocessing import StandardScaler from nltk.corpus import stopwords import nltk from sklearn.feature_extraction.text import TfidfVectorizer data = pd.r...
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 302, 198, 6738, 41927, 292, 13, 27530, 1330, 24604, 1843, 198, 6738, 41927, 292, 13, 75, 6962, 1330, 360, 1072, 198, 6738, 41927, 292, 13, 29988, 11799, 13, 36216, 15813, 62, 35720, 1330, 1...
2.553942
482
import time import matplotlib.pyplot as plt from confluent_kafka import Producer if __name__ == '__main__': plot_events_produced_frequency('first_half.txt')
[ 11748, 640, 198, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 6738, 1013, 28216, 62, 74, 1878, 4914, 1330, 30436, 628, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 7110,...
2.964286
56
# This file is part of postcipes # (c) Timofey Mukha # The code is released under the MIT Licence. # See LICENCE.txt and the Legal section in the README for more information from __future__ import absolute_import from __future__ import division from __future__ import print_function from .postcipe import Postcipe impor...
[ 2, 770, 2393, 318, 636, 286, 1281, 66, 18636, 198, 2, 357, 66, 8, 5045, 1659, 2959, 31509, 3099, 198, 2, 383, 2438, 318, 2716, 739, 262, 17168, 10483, 594, 13, 198, 2, 4091, 38559, 18310, 13, 14116, 290, 262, 16027, 2665, 287, 262...
3.433526
173
# MIT License # Copyright (c) 2017 MassChallenge, Inc. from impact.v1.helpers import JudgingRoundHelper from impact.v1.views.base_detail_view import BaseDetailView
[ 2, 17168, 13789, 198, 2, 15069, 357, 66, 8, 2177, 5674, 41812, 3540, 11, 3457, 13, 198, 198, 6738, 2928, 13, 85, 16, 13, 16794, 364, 1330, 47024, 22685, 47429, 198, 6738, 2928, 13, 85, 16, 13, 33571, 13, 8692, 62, 49170, 62, 1177,...
3.32
50
import boto3 import base64 aws_ecr_client = boto3.client('ecr') response = aws_ecr_client.describe_repositories() for repo in response['repositories']: response = aws_ecr_client.get_authorization_token(registryIds=[repo['registryId']]) print(f"{repo['repositoryName']}\t{repo['repositoryArn']}") #print(f"...
[ 11748, 275, 2069, 18, 198, 11748, 2779, 2414, 198, 198, 8356, 62, 721, 81, 62, 16366, 796, 275, 2069, 18, 13, 16366, 10786, 721, 81, 11537, 198, 198, 26209, 796, 3253, 82, 62, 721, 81, 62, 16366, 13, 20147, 4892, 62, 260, 1930, 27...
2.531429
175
""" Test constants :author: Angelo Cutaia :copyright: Copyright 2021, LINKS Foundation :version: 1.0.0 .. Copyright 2021 LINKS Foundation 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 Lice...
[ 37811, 198, 14402, 38491, 198, 198, 25, 9800, 25, 48886, 9712, 64, 544, 198, 25, 22163, 4766, 25, 15069, 33448, 11, 34426, 50, 5693, 198, 25, 9641, 25, 352, 13, 15, 13, 15, 198, 198, 492, 628, 220, 220, 220, 15069, 33448, 34426, 5...
2.034823
1,924
from datamodel_code_generator.parser.base import snake_to_upper_camel def test_snake_to_upper_camel_underscore(): """In case a name starts with a underline, we should keep it.""" assert snake_to_upper_camel('_hello') == '_Hello'
[ 6738, 4818, 321, 375, 417, 62, 8189, 62, 8612, 1352, 13, 48610, 13, 8692, 1330, 17522, 62, 1462, 62, 45828, 62, 66, 17983, 628, 198, 4299, 1332, 62, 16184, 539, 62, 1462, 62, 45828, 62, 66, 17983, 62, 41116, 7295, 33529, 198, 220, ...
2.811765
85
import cv2 import numpy as np import dk_ardruino import serial cam_mtx=np.load('utils/cam_mtx.npy') dist=np.load('utils/dist.npy') newcam_mtx=np.load('utils/newcam_mtx.npy') roi=np.load('utils/roi.npy') matrix = np.load('utils/abc.npy') area1 = int(open('utils/Resolution.txt').read().split('\n')[2]) width = i...
[ 11748, 269, 85, 17, 201, 198, 11748, 299, 32152, 355, 45941, 201, 198, 11748, 288, 74, 62, 446, 622, 2879, 201, 198, 11748, 11389, 201, 198, 20991, 62, 16762, 87, 28, 37659, 13, 2220, 10786, 26791, 14, 20991, 62, 16762, 87, 13, 77, ...
1.649324
2,960
# coding: utf-8 """ Defines Tournesol's backend API routes """ from django.urls import include, path from rest_framework import routers from .views import ComparisonDetailApi, ComparisonListApi, ComparisonListFilteredApi from .views.email_domains import EmailDomainsList from .views.exports import ExportAllView, Expo...
[ 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 37811, 198, 7469, 1127, 309, 1798, 274, 349, 338, 30203, 7824, 11926, 198, 37811, 198, 198, 6738, 42625, 14208, 13, 6371, 82, 1330, 2291, 11, 3108, 198, 6738, 1334, 62, 30604, 1330, 41144, 1...
2.282093
1,223
import numpy as np import win32gui, win32api import ctypes import mss sct = mss.mss()
[ 11748, 299, 32152, 355, 45941, 198, 11748, 1592, 2624, 48317, 11, 1592, 2624, 15042, 198, 11748, 269, 19199, 198, 11748, 285, 824, 198, 82, 310, 796, 285, 824, 13, 76, 824, 3419 ]
2.65625
32
import requests import requests_cache from collections import OrderedDict from datetime import datetime from dateutil import parser from operator import itemgetter from tabulate import tabulate SCHEDULE_URL = "http://pyohio.org/schedule/json/" def get_schedule(cache_ttl=3600): """ Get the schedule from the confer...
[ 11748, 7007, 198, 11748, 7007, 62, 23870, 198, 6738, 17268, 1330, 14230, 1068, 35, 713, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 3128, 22602, 1330, 30751, 198, 6738, 10088, 1330, 2378, 1136, 353, 198, 6738, 7400, 5039, 1330, ...
2.957328
539
from django.contrib.auth.models import User from rest_framework import serializers from django.contrib.auth import authenticate from django.core import exceptions from rest_framework.serializers import ModelSerializer from django.utils.translation import ugettext_lazy as _
[ 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 27530, 1330, 11787, 198, 6738, 1334, 62, 30604, 1330, 11389, 11341, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 1330, 8323, 5344, 198, 6738, 42625, 14208, 13, 7295, 1330, 13269, 1...
3.928571
70
# Generated by Django 3.1.5 on 2021-01-08 22:16 from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 513, 13, 16, 13, 20, 319, 33448, 12, 486, 12, 2919, 2534, 25, 1433, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.84375
32
# encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals from django import VERSION as DJANGO_VERSION from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.models.loading import get_app, get_model, get_models from django.util...
[ 2, 21004, 25, 3384, 69, 12, 23, 198, 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 11, 7297, 11, 3601, 62, 8818, 11, 28000, 1098, 62, 17201, 874, 198, 198, 6738, 42625, 14208, 1330, 44156, 2849, 355, 13004, 1565, 11230, 62, 43717, ...
2.932584
356
# Copyright 2019 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. import json import os import sys import time import signal signal.signal( ( signal.SIGBREAK # pylint: disable=no-member if sys.p...
[ 2, 15069, 13130, 383, 406, 9598, 40, 46665, 13, 1439, 2489, 10395, 13, 198, 2, 5765, 286, 428, 2723, 2438, 318, 21825, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 198, 2, 326, 460, 307, 1043, 287, 262, 38559, 24290, 2393, 13, ...
2.564179
335
from time import sleep import os from animations import progress_bar from threading import Thread import sys import time # for i in range(100): # time.sleep(0.1) # sys.stdout.write(f'salutare-{i}\n') # sys.stdout.write(f'andrew-{i}\n') # sys.stdout.write("\x1b[1A") # cursor up one line # sys.s...
[ 198, 6738, 640, 1330, 3993, 198, 11748, 28686, 198, 6738, 22407, 1330, 4371, 62, 5657, 198, 198, 6738, 4704, 278, 1330, 14122, 198, 198, 11748, 25064, 198, 11748, 640, 198, 198, 2, 329, 1312, 287, 2837, 7, 3064, 2599, 198, 2, 220, 2...
2.383613
537
from attributes.unit_test.discoverer import TestDiscoverer
[ 6738, 12608, 13, 20850, 62, 9288, 13, 15410, 659, 11751, 1330, 6208, 15642, 659, 11751, 628 ]
3.75
16
import garble import wx from multiprocessing import freeze_support import sys import os from pathlib import Path # pyinstaller GarbleExecutable.py --onefile -w --add-data ./venv/Lib/site-packages/clkhash/data;clkhash/data --add-data ./venv/Lib/site-packages/clkhash/schemas;clkhash/schemas --add-data ./example-schema;...
[ 11748, 5482, 903, 198, 11748, 266, 87, 198, 6738, 18540, 305, 919, 278, 1330, 16611, 62, 11284, 198, 11748, 25064, 198, 11748, 28686, 198, 6738, 3108, 8019, 1330, 10644, 198, 198, 2, 12972, 17350, 263, 7164, 903, 23002, 18187, 13, 9078,...
2.648649
185
''' ================================================================= @version 2.0 @author Ashwin Ramadevanahalli @title Testing. Main module. ================================================================= ''' import os import sys import subprocess import testset_parse import gcov_parse import rand_pr...
[ 7061, 6, 220, 220, 198, 23926, 28, 198, 197, 31, 9641, 220, 362, 13, 15, 198, 197, 31, 9800, 220, 220, 7844, 5404, 7431, 671, 10438, 993, 36546, 198, 197, 31, 7839, 220, 220, 220, 23983, 13, 628, 198, 197, 13383, 8265, 13, 198, ...
3.033466
1,255