content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
import tensorflow as tf import numpy as np import scipy.io as scio import math as ma import multiprocessing as mp from tensorflow.contrib import layers import time import os main()
[ 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 629, 541, 88, 13, 952, 355, 629, 952, 198, 11748, 10688, 355, 17266, 198, 11748, 18540, 305, 919, 278, 355, 29034, 198, 6738, 11192, 273, 11125, 13, ...
2.697368
76
from keras.preprocessing import image import requests import numpy as np from keras.applications.vgg16 import VGG16, preprocess_input, decode_predictions model = VGG16(include_top=True, weights='imagenet', input_tensor=None, input_shape=None) model.summary() #画像をダンロードするための関数 if __name__ == '__main__': #画像のダウ...
[ 6738, 41927, 292, 13, 3866, 36948, 1330, 2939, 198, 11748, 7007, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 41927, 292, 13, 1324, 677, 602, 13, 85, 1130, 1433, 1330, 569, 11190, 1433, 11, 662, 14681, 62, 15414, 11, 36899, 62, 2876...
1.950226
442
from typing import Any, Dict, Tuple from qcengine.exceptions import InputError def format_keywords(keywords: Dict[str, Any]) -> str: """Form keywords deck from dictionary `keywords` where keys are CFOUR keyword ("__" separating any nested-module keywords) strings and values are Python formatted. """ ...
[ 6738, 19720, 1330, 4377, 11, 360, 713, 11, 309, 29291, 198, 198, 6738, 10662, 66, 18392, 13, 1069, 11755, 1330, 23412, 12331, 628, 198, 4299, 5794, 62, 2539, 10879, 7, 2539, 10879, 25, 360, 713, 58, 2536, 11, 4377, 12962, 4613, 965, ...
2.138264
933
# -*- coding: utf8 -*- """ Tests for the encoding library. Author: Eduardo Ferreira License: MIT (see LICENSE for details) """ import unittest class EncodeTests(unittest.TestCase): """ Tests for the encoding library. """ def test_dummy(self): """ Dummy test method. """ ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 23, 532, 9, 12, 198, 198, 37811, 198, 51, 3558, 329, 262, 21004, 5888, 13, 198, 198, 13838, 25, 40766, 13109, 12880, 260, 8704, 198, 34156, 25, 17168, 357, 3826, 38559, 24290, 329, 3307, 8, 198,...
2.385135
148
from configcrunch.tests.acceptance.testcases import ConfigcrunchTestCase
[ 6738, 4566, 6098, 3316, 13, 41989, 13, 13635, 590, 13, 9288, 33964, 1330, 17056, 6098, 3316, 14402, 20448, 628 ]
3.894737
19
# Copyright 2021 The MLX Contributors # # SPDX-License-Identifier: Apache-2.0 from kfp import dsl from kfp_tekton.compiler import TektonCompiler from kfp_tekton import TektonClient from os import path from tempfile import gettempdir ############################################################ # Define ...
[ 2, 15069, 33448, 383, 10373, 55, 25767, 669, 198, 2, 220, 198, 2, 30628, 55, 12, 34156, 12, 33234, 7483, 25, 24843, 12, 17, 13, 15, 198, 198, 6738, 479, 46428, 1330, 288, 6649, 198, 6738, 479, 46428, 62, 35424, 1122, 13, 5589, 532...
3.39372
414
from .client import BaseAPI, CorporateAPI, PersonalAPI from .errors import Error, TooManyRequests
[ 6738, 764, 16366, 1330, 7308, 17614, 11, 26040, 17614, 11, 15644, 17614, 198, 6738, 764, 48277, 1330, 13047, 11, 14190, 7085, 16844, 3558, 198 ]
4.083333
24
from parse_one_paged import parse_one_paged AVAILABLE_SITES = [ { 'name': 'make up', 'url': 'https://makeup.com.ua/brand/1771098/', 'product_class': '.simple-slider-list__link', 'name_class': '.simple-slider-list__name', 'price_class': '.simple-slider-list__price', '...
[ 6738, 21136, 62, 505, 62, 79, 1886, 1330, 21136, 62, 505, 62, 79, 1886, 198, 198, 10116, 32, 4146, 17534, 62, 50, 2043, 1546, 796, 685, 198, 220, 220, 220, 1391, 198, 220, 220, 220, 220, 220, 220, 220, 705, 3672, 10354, 705, 15883...
2.146718
259
KEY_PARTS_OF_SPEECH = ["ADJ", "NOUN", "NUM", "VERB", "X"]
[ 20373, 62, 27082, 4694, 62, 19238, 62, 4303, 36, 25994, 796, 14631, 2885, 41, 1600, 366, 45, 19385, 1600, 366, 41359, 1600, 366, 5959, 33, 1600, 366, 55, 8973, 198 ]
1.933333
30
# 绘图相关包 from PyQt5.Qt import * from pyqtgraph import PlotWidget from PyQt5 import QtCore import numpy as np import pyqtgraph as pq # 绘图相关包 import cv2 import math import torch import pyrealsense2 as rs #人体姿态估计相关包 from models.with_mobilenet import PoseEstimationWithMobileNet from modules.keypoints import...
[ 2, 13328, 119, 246, 32368, 122, 33566, 116, 17739, 111, 44293, 227, 201, 198, 6738, 9485, 48, 83, 20, 13, 48, 83, 1330, 1635, 201, 198, 6738, 12972, 80, 25297, 1470, 1330, 28114, 38300, 201, 198, 6738, 9485, 48, 83, 20, 1330, 33734,...
1.550933
697
import datetime nascimento = int(input('Digite seu ano de nascimento: ')) anoAtual = datetime.date.today().year idade = anoAtual - nascimento print('A idade do atleta é {}'.format(idade)) if idade <= 9: print('A categoria do atleta é MIRIM') elif idade > 9 and idade <= 14: print('A categoria do atleta é INF...
[ 11748, 4818, 8079, 198, 198, 77, 3372, 3681, 78, 796, 493, 7, 15414, 10786, 19511, 578, 384, 84, 281, 78, 390, 299, 3372, 3681, 78, 25, 705, 4008, 198, 198, 5733, 2953, 723, 796, 4818, 8079, 13, 4475, 13, 40838, 22446, 1941, 198, ...
2.462963
216
from django.test import TestCase from .models import WikiGame, WikiTermos from .csv_data_extracter import extract_data_from_csv, save_termos, save_wikigame, extract_termos_from_string, refresh_wikigame_model
[ 6738, 42625, 14208, 13, 9288, 1330, 6208, 20448, 198, 6738, 764, 27530, 1330, 13078, 8777, 11, 13078, 40596, 418, 198, 6738, 764, 40664, 62, 7890, 62, 2302, 974, 263, 1330, 7925, 62, 7890, 62, 6738, 62, 40664, 11, 3613, 62, 4354, 418,...
3.184615
65
# ----------------------------------------------------------------------------- # Copyright (c) 2015, Nicolas P. Rougier. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------- import numpy as np impo...
[ 2, 16529, 32501, 198, 2, 15069, 357, 66, 8, 1853, 11, 29737, 350, 13, 13876, 70, 959, 13, 1439, 6923, 33876, 13, 198, 2, 4307, 6169, 739, 262, 357, 3605, 8, 347, 10305, 13789, 13, 4091, 38559, 24290, 13, 14116, 329, 517, 7508, 13,...
2.66055
436
"""Main application unittests.""" from fastapi.testclient import TestClient from app.main import app client = TestClient(app) def test_docs(): """Return HTML docs for root route.""" response = client.get('/') assert response.status_code == 200 assert response.headers['content-type'].startswith('text...
[ 37811, 13383, 3586, 555, 715, 3558, 526, 15931, 198, 6738, 3049, 15042, 13, 9288, 16366, 1330, 6208, 11792, 198, 198, 6738, 598, 13, 12417, 1330, 598, 198, 198, 16366, 796, 6208, 11792, 7, 1324, 8, 628, 198, 4299, 1332, 62, 31628, 335...
3.215686
102
from gazette.spiders.base import FecamGazetteSpider
[ 6738, 308, 1031, 5857, 13, 2777, 4157, 13, 8692, 1330, 376, 721, 321, 38, 1031, 5857, 41294, 628 ]
2.944444
18
import config import json import traceback import requests # maximum length of an error message to be stored # excessive error messages might make it properly to the manager MAX_ERROR_LENGTH = 2 * 1024 * 1024 # create an instance for export Manager = Manager_Service()
[ 11748, 4566, 198, 11748, 33918, 198, 11748, 12854, 1891, 198, 11748, 7007, 198, 198, 2, 5415, 4129, 286, 281, 4049, 3275, 284, 307, 8574, 198, 2, 13181, 4049, 6218, 1244, 787, 340, 6105, 284, 262, 4706, 198, 22921, 62, 24908, 62, 43, ...
4.136364
66
import argparse import os from bld2repo import (get_buildrequire_pkgs_from_build, add_rpm_urls, rpm_bulk_download, create_repo) from bld2repo.config import Config from bld2repo.utils import get_koji_session if __name__ == "__main__": main()
[ 11748, 1822, 29572, 198, 11748, 28686, 198, 198, 6738, 275, 335, 17, 260, 7501, 1330, 357, 1136, 62, 11249, 46115, 62, 35339, 82, 62, 6738, 62, 11249, 11, 751, 62, 48235, 62, 6371, 82, 11, 37542, 62, 65, 12171, 62, 15002, 11, 198, ...
2.353448
116
from rllab.envs.mujoco.gather.gather_env import GatherEnv from sandbox.finetuning.envs.mujoco.swimmer_unevenfloor_env import SwimmerUnevenFloorEnv if __name__ == "__main__": env = SwimmerGatherUnevenFloorEnv() while True: env.reset() for _ in range(1000): env.render() _...
[ 6738, 374, 297, 397, 13, 268, 14259, 13, 76, 23577, 25634, 13, 70, 1032, 13, 70, 1032, 62, 24330, 1330, 402, 1032, 4834, 85, 198, 6738, 35204, 13, 15643, 316, 46493, 13, 268, 14259, 13, 76, 23577, 25634, 13, 2032, 10957, 62, 1726, ...
2.291954
435
from django.conf.urls import url from . import views urlpatterns = [ url(r'^(?P<strategy_name>[-\w]+)/(?P<pk>\d+)/$', views.AjaxBaseSerializedView.as_view(), name='django-easy-ajax-selector'), ]
[ 6738, 42625, 14208, 13, 10414, 13, 6371, 82, 1330, 19016, 198, 198, 6738, 764, 1330, 5009, 628, 198, 6371, 33279, 82, 796, 685, 198, 220, 220, 220, 19016, 7, 81, 6, 61, 7, 30, 47, 27, 2536, 4338, 62, 3672, 36937, 12, 59, 86, 486...
2.164948
97
import copy import math import numpy from tqdm import tqdm import matplotlib.pyplot as plt #A class for three-dimentional vector operations; using numpy arrays and their operations was found to be slower. #Returns the unit vector pointing from the location represented by fromVector to the lo...
[ 11748, 4866, 201, 198, 11748, 10688, 201, 198, 11748, 299, 32152, 201, 198, 6738, 256, 80, 36020, 1330, 256, 80, 36020, 201, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 201, 198, 201, 198, 201, 198, 2, 32, 1398, 32...
2.378174
1,851
#// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #// SPDX-License-Identifier: MIT-0 import sys import hashlib if len(sys.argv) !=3: print("Usage: calc-s3-etag.py {file} {multipart-transfer size}") print("") print("Multipart transfersize may be gotten by referencing the .aws/config fil...
[ 2, 1003, 15069, 6186, 13, 785, 11, 3457, 13, 393, 663, 29116, 13, 1439, 6923, 33876, 13, 198, 2, 1003, 30628, 55, 12, 34156, 12, 33234, 7483, 25, 17168, 12, 15, 198, 198, 11748, 25064, 198, 11748, 12234, 8019, 198, 361, 18896, 7, ...
3.159864
294
from startmicro.utils.version import get_version VERSION = (0, 0, 6, 'alpha', 0) __version__ = get_version(VERSION) __author__ = "Munis Isazade <munisisazade@gmail.com>"
[ 6738, 923, 24055, 13, 26791, 13, 9641, 1330, 651, 62, 9641, 198, 198, 43717, 796, 357, 15, 11, 657, 11, 718, 11, 705, 26591, 3256, 657, 8, 198, 198, 834, 9641, 834, 796, 651, 62, 9641, 7, 43717, 8, 198, 198, 834, 9800, 834, 796,...
2.703125
64
#!/usr/bin/python import socket try: print "\n Sending ""evil"" buffer..." padding = "A" * 780 eip = "B" * 4 buffer = "C" * 16 payload = padding + eip + buffer content = "username=" + payload + "&password=A" buffer = "POST /login HTTP/1.1\r\n" buffer += "Host: 192.168.1.1\r\n" buf...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 198, 11748, 17802, 198, 198, 28311, 25, 198, 220, 220, 220, 220, 220, 220, 220, 3601, 37082, 77, 32038, 13538, 23542, 15931, 11876, 9313, 198, 197, 197, 198, 197, 39231, 796, 366, 32, 1, 16...
2.123134
536
import os from abc import abstractmethod from functools import partial import collections import torch import torch.nn as nn import core.util as Util from core.logger import LogTracker CustomResult = collections.namedtuple('CustomResult', 'name result')
[ 11748, 28686, 198, 6738, 450, 66, 1330, 12531, 24396, 198, 6738, 1257, 310, 10141, 1330, 13027, 198, 11748, 17268, 198, 198, 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 198, 11748, 4755, 13, 22602, 355, 7273, 346, 198...
3.820896
67
import argparse import os from pathlib import Path import sys sys.path.append(str(Path(__file__).parent.parent)) import pandas as pd from skimage.io import imread, imsave from joblib import Parallel, delayed from utils.metrics import * parser = argparse.ArgumentParser() parser.add_argument('pred_root') args = parse...
[ 11748, 1822, 29572, 198, 11748, 28686, 198, 6738, 3108, 8019, 1330, 10644, 198, 11748, 25064, 198, 198, 17597, 13, 6978, 13, 33295, 7, 2536, 7, 15235, 7, 834, 7753, 834, 737, 8000, 13, 8000, 4008, 198, 198, 11748, 19798, 292, 355, 279...
2.664773
704
import numpy as np from tqdm import tqdm import statistics as stats from astropy import units as u from scipy.signal import medfilt from scipy.optimize import curve_fit from astropy.table import Table, Column from astropy.timeseries import LombScargle __all__ = ['MeasureProt'] class MeasureProt(object): """ U...
[ 11748, 299, 32152, 355, 45941, 198, 6738, 256, 80, 36020, 1330, 256, 80, 36020, 198, 11748, 7869, 355, 9756, 198, 6738, 6468, 28338, 1330, 4991, 355, 334, 198, 6738, 629, 541, 88, 13, 12683, 282, 1330, 1117, 69, 2326, 198, 6738, 629, ...
1.788563
7,572
from typing import List from fastapi import APIRouter, Depends, HTTPException, status from app import schemas, models from app.services.jwt import get_current_user router = APIRouter( prefix="/flashcard", tags=["flashcard"] ) # Create new flashcard @router.post("/", response_model=schemas.Flashcard) # L...
[ 6738, 19720, 1330, 7343, 198, 198, 6738, 3049, 15042, 1330, 3486, 4663, 39605, 11, 2129, 2412, 11, 14626, 16922, 11, 3722, 198, 198, 6738, 598, 1330, 3897, 5356, 11, 4981, 198, 6738, 598, 13, 30416, 13, 73, 46569, 1330, 651, 62, 14421...
2.915408
331
''' This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de). PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any late...
[ 7061, 6, 198, 220, 220, 220, 770, 2393, 318, 636, 286, 3122, 19, 20519, 357, 5167, 14151, 25, 3740, 1378, 4426, 19, 9078, 13, 11147, 13, 69, 430, 403, 71, 30288, 13, 2934, 737, 628, 220, 220, 220, 3122, 19, 20519, 318, 1479, 3788,...
3.002907
344
from __future__ import annotations import os from datetime import datetime import coolname # type: ignore from dotenv import load_dotenv load_dotenv() def setup_rundir(): """ Create a working directory with a randomly generated run name. """ date = datetime.now().strftime("%Y%m%d-%H%M") name =...
[ 6738, 11593, 37443, 834, 1330, 37647, 198, 198, 11748, 28686, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 198, 11748, 3608, 3672, 220, 1303, 2099, 25, 8856, 198, 6738, 16605, 24330, 1330, 3440, 62, 26518, 24330, 198, 198, 2220, 62, 26...
2.315029
346
"""Module for the string helper functions and primitive data types.""" from __future__ import annotations import ast import typing import apm # WPS600 - inheritance from the str is the only way to implement correct # error message with all str functionality class ErrorMessage(str): # noqa: WPS600 """Implement...
[ 37811, 26796, 329, 262, 4731, 31904, 5499, 290, 20049, 1366, 3858, 526, 15931, 198, 198, 6738, 11593, 37443, 834, 1330, 37647, 198, 198, 11748, 6468, 198, 11748, 19720, 198, 198, 11748, 2471, 76, 628, 198, 2, 370, 3705, 8054, 532, 24155...
2.59348
1,043
""" HexByteConversion Convert a byte string to it's hex representation for output or visa versa. ByteToHex converts byte string "\xFF\xFE\x00\x01" to the string "FF FE 00 01" HexToByte converts string "FF FE 00 01" to the byte string "\xFF\xFE\x00\x01" """ #-----------------------------------------------------------...
[ 37811, 198, 39, 1069, 40778, 3103, 9641, 198, 198, 3103, 1851, 257, 18022, 4731, 284, 340, 338, 17910, 10552, 329, 5072, 393, 14552, 25470, 13, 198, 198, 40778, 2514, 39, 1069, 26161, 18022, 4731, 37082, 87, 5777, 59, 87, 15112, 59, 8...
2.67893
897
# -------------------------------------------------------- # Pytorch Meta R-CNN # Written by Anny Xu, Xiaopeng Yan, based on the code from Jianwei Yang # -------------------------------------------------------- import _init_paths import os import sys import numpy as np import argparse import pprint import pdb import ti...
[ 2, 20368, 22369, 198, 2, 9485, 13165, 354, 30277, 371, 12, 18474, 198, 2, 22503, 416, 1052, 3281, 33591, 11, 22450, 404, 1516, 10642, 11, 1912, 319, 262, 2438, 422, 40922, 42990, 10998, 198, 2, 20368, 22369, 198, 11748, 4808, 15003, 6...
1.924292
12,152
import scripts.gui_elements import scripts.tools from scripts.Colors import Color from scripts.variables.localvars import * from systems.BaseSystem import BaseSystem from scripts import highlights # HELPER FUNCTIONS #
[ 11748, 14750, 13, 48317, 62, 68, 3639, 198, 11748, 14750, 13, 31391, 198, 6738, 14750, 13, 5216, 669, 1330, 5315, 198, 6738, 14750, 13, 25641, 2977, 13, 12001, 85, 945, 1330, 1635, 198, 6738, 3341, 13, 14881, 11964, 1330, 7308, 11964, ...
3.79661
59
# coding=utf-8 """ Events specific to Mumble-based protocols """ __author__ = 'Gareth Coles' from system.events.base import BaseEvent class MumbleEvent(BaseEvent): """ A Mumble event. This will only be thrown from the Mumble protocol. If an event subclasses this, chances are it's a Mumble event. ""...
[ 2, 19617, 28, 40477, 12, 23, 198, 198, 37811, 198, 37103, 2176, 284, 337, 10344, 12, 3106, 19565, 198, 37811, 198, 198, 834, 9800, 834, 796, 705, 38, 26659, 1623, 274, 6, 198, 198, 6738, 1080, 13, 31534, 13, 8692, 1330, 7308, 9237, ...
2.515043
4,188
""" Django settings for wagtail_template project. Generated by 'django-admin startproject' using Django 4.0.3. For more information on this file, see https://docs.djangoproject.com/en/4.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.0/ref/settings/ """ # B...
[ 37811, 198, 35, 73, 14208, 6460, 329, 266, 363, 13199, 62, 28243, 1628, 13, 198, 198, 8645, 515, 416, 705, 28241, 14208, 12, 28482, 923, 16302, 6, 1262, 37770, 604, 13, 15, 13, 18, 13, 198, 198, 1890, 517, 1321, 319, 428, 2393, 11...
2.371019
2,857
from __future__ import absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement from django import template from ..models import Seat register = template.Library() @register.filter @register.inclusion_tag('seat.html', takes_context=True)
[ 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 11, 7297, 11, 27298, 11, 28376, 62, 1416, 13920, 11, 3601, 62, 8818, 11, 28000, 1098, 62, 17201, 874, 11, 351, 62, 26090, 198, 198, 6738, 42625, 14208, 1330, 11055, 198, 198, 6738, 11485...
3.65
80
import threading import os import obd from random import random from pathlib import Path conn = obd.OBD() connect = obd.Async(fast=False) speed="" fueli="" tem ="" connect.watch(obd.commands.INTAKE_TEMP,callback=get_temp) connect.watch(obd.commands.FUEL_LEVEL,callback=get_fuel) connect.watch(obd.comma...
[ 11748, 4704, 278, 220, 198, 11748, 28686, 198, 11748, 909, 67, 198, 6738, 4738, 1330, 4738, 198, 6738, 3108, 8019, 1330, 10644, 628, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 198, 37043, 796, 909, 67, 13, 9864, 35, 3419, 198...
2.344398
241
# Core Library import logging # Third party from gym.envs.registration import register logger = logging.getLogger(__name__) register(id="Mouse-v0", entry_point="gym_mouse.envs:MouseEnv")
[ 2, 7231, 10074, 198, 11748, 18931, 198, 198, 2, 10467, 2151, 198, 6738, 11550, 13, 268, 14259, 13, 2301, 33397, 1330, 7881, 198, 198, 6404, 1362, 796, 18931, 13, 1136, 11187, 1362, 7, 834, 3672, 834, 8, 198, 198, 30238, 7, 312, 2625...
2.953125
64
#Given an n-ary tree, # return the postorder # traversal of its nodes' values. #Recursion is easy to implement and understand by definition # https://en.wikipedia.org/wiki/Tree_traversal#Post-order_(LRN)
[ 2, 15056, 281, 299, 12, 560, 5509, 11, 220, 198, 2, 1441, 262, 1281, 2875, 220, 198, 2, 33038, 282, 286, 663, 13760, 6, 3815, 13, 198, 2, 6690, 24197, 318, 2562, 284, 3494, 290, 1833, 416, 6770, 220, 198, 2, 3740, 1378, 268, 13,...
3.119403
67
from flask_restful import Resource, reqparse, request from flask_restful import fields, marshal_with, marshal from sqlalchemy.exc import IntegrityError from sqlalchemy import or_, and_, text from flask_jwt_extended import jwt_required from models.keyword import Keyword from app import db from utils.util import max_res ...
[ 6738, 42903, 62, 2118, 913, 1330, 20857, 11, 43089, 29572, 11, 2581, 198, 6738, 42903, 62, 2118, 913, 1330, 7032, 11, 22397, 282, 62, 4480, 11, 22397, 282, 198, 6738, 44161, 282, 26599, 13, 41194, 1330, 39348, 12331, 198, 6738, 44161, ...
3.572816
103
import os directory = os.path.dirname(__file__)
[ 11748, 28686, 198, 198, 34945, 796, 28686, 13, 6978, 13, 15908, 3672, 7, 834, 7753, 834, 8, 628, 198 ]
2.684211
19
import os, sys, cyclone.web import pyobf from twisted.python import log from twisted.internet import reactor if __name__ == "__main__": log.startLogging(sys.stdout) port = int(os.environ.get('PORT', 5000)) reactor.listenTCP(port, Application()) reactor.run()
[ 11748, 28686, 11, 25064, 11, 11700, 505, 13, 12384, 198, 11748, 12972, 672, 69, 198, 6738, 19074, 13, 29412, 1330, 2604, 198, 6738, 19074, 13, 37675, 1330, 21905, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, ...
2.826531
98
"""This file defines a URL validators based on Django ones. """ import re # ---------------------------------------------------------------------------------------------------------------------- """ this regex is different from the one defined by Django because: - in our case protocol is optional - I decided t...
[ 37811, 1212, 2393, 15738, 257, 10289, 4938, 2024, 1912, 319, 37770, 3392, 13, 198, 198, 37811, 198, 198, 11748, 302, 198, 198, 2, 16529, 3880, 19351, 438, 198, 198, 37811, 428, 40364, 318, 1180, 422, 262, 530, 5447, 416, 37770, 780, 2...
3.545906
403
#!/usr/bin/env python3.6 import random def init(): ''' This builds the deck to draw from. This runs at the beginning of the program then shoud only be run to start a new game. ''' # These are the possible face values and suits for the cards. cardfaces = ("A","K","Q","J","10","9","8","7",...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 13, 21, 198, 198, 11748, 4738, 628, 198, 4299, 2315, 33529, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 770, 12188, 262, 6203, 284, 3197, 422, 13, 198, 220, 220, 220, 770, 45...
2.189347
3,248
import os import json import shutil from peewee import SqliteDatabase from wearebeautiful.db_model import DBModel, db, create_from_manifest from wearebeautiful.manifest import validate_manifest import config DB_FILE = "wab-models.db" MIN_SURFACE_MED_SIZE = 8 * 1024 * 1024 MAX_SURFACE_MED_SIZE = 12 * 1024 * 1024 MIN_S...
[ 11748, 28686, 198, 11748, 33918, 198, 11748, 4423, 346, 198, 198, 6738, 613, 413, 1453, 1330, 311, 13976, 578, 38105, 198, 6738, 356, 533, 40544, 4135, 13, 9945, 62, 19849, 1330, 20137, 17633, 11, 20613, 11, 2251, 62, 6738, 62, 805, 8...
2.765517
145
# print(pig_latin("Python")) # print(pig_latin("computer")) # print(pig_latin(("air"))) # print(ubbi_dubbi()) get_running_avg()
[ 198, 198, 2, 3601, 7, 79, 328, 62, 75, 10680, 7203, 37906, 48774, 198, 2, 3601, 7, 79, 328, 62, 75, 10680, 7203, 33215, 48774, 198, 2, 3601, 7, 79, 328, 62, 75, 10680, 7, 7203, 958, 1, 22305, 628, 198, 198, 2, 3601, 7, 549, ...
2.15873
63
from flask import Flask app = Flask(__name__) @app.route('/') if __name__ == '__main__': app.run()
[ 6738, 42903, 1330, 46947, 198, 198, 1324, 796, 46947, 7, 834, 3672, 834, 8, 628, 198, 31, 1324, 13, 38629, 10786, 14, 11537, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 598, 13, 5143, 3419...
2.454545
44
from django.contrib import admin # Register your models here. from accounts.models import Customer admin.site.register(Customer)
[ 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 198, 2, 17296, 534, 4981, 994, 13, 198, 6738, 5504, 13, 27530, 1330, 22092, 198, 198, 28482, 13, 15654, 13, 30238, 7, 44939, 8 ]
3.939394
33
''' def compare(file1, file2): f1 = open(file1, 'r') f2 = open(file2, 'r') right_counter = 0 wrong_lines = [] for i in range(50): r1 = f1.readline() r2 = f2.readline() r1 = r1.strip('\n') r2 = r2.strip('\n') if r1[-1:] == r2[-1:]: right_counter += 1 else: wrong_lines.append(i) print('Wrong lin...
[ 198, 7061, 6, 198, 4299, 8996, 7, 7753, 16, 11, 2393, 17, 2599, 198, 197, 69, 16, 796, 1280, 7, 7753, 16, 11, 705, 81, 11537, 198, 197, 69, 17, 796, 1280, 7, 7753, 17, 11, 705, 81, 11537, 628, 197, 3506, 62, 24588, 796, 657, ...
2.151899
237
#!/usr/bin/env python # -*- coding: utf-8 -*- from db import SessionFactory, Engine __all__ = [ SessionFactory, Engine ]
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 20613, 1330, 23575, 22810, 11, 7117, 198, 198, 834, 439, 834, 796, 685, 198, 197, 36044, 22810, 11, 198, 197, 1...
2.604167
48
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Глобальный файл настроек """ # ###################################################################################################################### # Класс для выделения текста # ######################################################################################...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 37811, 198, 140, 241, 30143, 25443, 109, 16142, 30143, 45367, 22177, 45035, 140, 117, 220, 141, 226, 16142, 140, 1...
4.571014
345
import cv2 import imutils import time import threading import serial import RPi.GPIO as GPIO from bluetooth import * from serial.serialutil import SerialException # -------------------변수 선언 부분------------------- port = "/dev/ttyACM0" reset_timer_seconds = -1 angles = [150, 120, 130] arduino = serial.Serial(port, 11520...
[ 11748, 269, 85, 17, 198, 11748, 545, 26791, 198, 11748, 640, 198, 11748, 4704, 278, 198, 11748, 11389, 198, 11748, 25812, 72, 13, 16960, 9399, 355, 50143, 198, 6738, 48208, 16271, 1330, 1635, 198, 6738, 11389, 13, 46911, 22602, 1330, 23...
2.024857
1,046
#!/usr/bin/env python # # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import unittest from onefuzztypes.validators import check_alnum_dash if __name__ == "__main__": unittest.main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 198, 2, 15069, 357, 66, 8, 5413, 10501, 13, 198, 2, 49962, 739, 262, 17168, 13789, 13, 198, 198, 11748, 555, 715, 395, 198, 198, 6738, 530, 69, 4715, 19199, 13, 12102, 2024, 133...
2.945946
74
# -*- coding: utf-8 -*- # quotequail # a library that identifies quoted text in email messages import re from . import _internal __all__ = ['quote', 'quote_html', 'unwrap', 'unwrap_html'] def quote(text, limit=1000): """ Takes a plain text message as an argument, returns a list of tuples. The first arg...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 9577, 421, 603, 198, 2, 257, 5888, 326, 21079, 10947, 2420, 287, 3053, 6218, 198, 198, 11748, 302, 198, 198, 6738, 764, 1330, 4808, 32538, 198, 198, 834, 439, 834, ...
2.342472
2,371
from django.core.exceptions import ImproperlyConfigured import os, hashlib import confy BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) confy.read_environment_file(BASE_DIR+"/.env") os.environ.setdefault("BASE_DIR", BASE_DIR) from ledger.settings_base import * ROOT_URLCONF = 'disturbance.urls...
[ 6738, 42625, 14208, 13, 7295, 13, 1069, 11755, 1330, 12205, 525, 306, 16934, 1522, 198, 198, 11748, 28686, 11, 12234, 8019, 198, 11748, 1013, 88, 198, 33, 11159, 62, 34720, 796, 28686, 13, 6978, 13, 15908, 3672, 7, 418, 13, 6978, 13, ...
2.353152
3,347
from django.apps import AppConfig
[ 6738, 42625, 14208, 13, 18211, 1330, 2034, 16934, 201, 198, 201, 198 ]
3.083333
12
# -*- coding: utf-8 -*- import string import random from jinja2 import Template, Environment, FileSystemLoader baseDir = "c:\\provision" # which extension number we should start start_ext = 821 extensionHeader = """#cid_number,transfer,mailbox,type,qualify,hasdirectory,call-limit,host,context,fullname,se...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 11748, 4731, 201, 198, 11748, 4738, 201, 198, 6738, 474, 259, 6592, 17, 1330, 37350, 11, 9344, 11, 9220, 11964, 17401, 201, 198, 201, 198, 201, 198, 201, 198, 869...
2.418605
645
from flask import Blueprint, current_app, jsonify, request from alerta.app import custom_webhooks from alerta.exceptions import ApiError from alerta.utils.response import absolute_url api = Blueprint('api', __name__) from . import alerts, blackouts, config, customers, groups, heartbeats, keys, oembed, permissions, u...
[ 6738, 42903, 1330, 39932, 11, 1459, 62, 1324, 11, 33918, 1958, 11, 2581, 198, 198, 6738, 7995, 64, 13, 1324, 1330, 2183, 62, 12384, 25480, 82, 198, 6738, 7995, 64, 13, 1069, 11755, 1330, 5949, 72, 12331, 198, 6738, 7995, 64, 13, 267...
3.077844
167
#!/usr/bin/python # build_native.py # Build native codes import sys import os, os.path import shutil from optparse import OptionParser import cocos import cocos_project import json import re from xml.dom import minidom import project_compile BUILD_CFIG_FILE="build-cfg.json"
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 2, 1382, 62, 30191, 13, 9078, 198, 2, 10934, 6868, 12416, 628, 198, 11748, 25064, 198, 11748, 28686, 11, 28686, 13, 6978, 198, 11748, 4423, 346, 198, 6738, 2172, 29572, 1330, 16018, 46677, 19...
3.1
90
from robot.api.deco import not_keyword
[ 6738, 9379, 13, 15042, 13, 12501, 78, 1330, 407, 62, 2539, 4775, 628 ]
3.076923
13
l1 = [1, 3, 5, 7, 9] # list mutable (read write) t1 = (1, 3, 5, 7, 9) # tuple imutable (read only) f(l1) print(l1) f(t1) print(t1)
[ 75, 16, 796, 685, 16, 11, 513, 11, 642, 11, 767, 11, 860, 60, 220, 1303, 1351, 4517, 540, 357, 961, 3551, 8, 198, 83, 16, 796, 357, 16, 11, 513, 11, 642, 11, 767, 11, 860, 8, 220, 1303, 46545, 545, 18187, 357, 961, 691, 8, ...
1.837838
74
# Copyright 2020 Filippo Aleotti, Fabio Tosi, Li Zhang, Matteo Poggi, Stefano Mattoccia # # 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 # # ...
[ 2, 15069, 12131, 376, 8908, 78, 9300, 26380, 11, 14236, 952, 309, 21707, 11, 7455, 19439, 11, 38789, 78, 350, 10332, 72, 11, 22350, 5733, 4705, 13966, 544, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, ...
2.794168
583
# Import # # Django from django.contrib.auth.mixins import LoginRequiredMixin from django.http import HttpResponseRedirect from django.shortcuts import render from django.views import View from django.urls import reverse from django.utils import timezone # App from .forms import BookmarkForm from .models import Bookma...
[ 2, 17267, 1303, 198, 2, 37770, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 19816, 1040, 1330, 23093, 37374, 35608, 259, 198, 6738, 42625, 14208, 13, 4023, 1330, 367, 29281, 31077, 7738, 1060, 198, 6738, 42625, 14208, 13, 1950...
3.392523
107
''' Created on Apr 21, 2015 @author: xapharius ''' import numpy as np import pandas as pd from datahandler.numerical2.numerical_data_handler import NumericalDataHandler from sklearn.linear_model.logistic import LogisticRegression from factory.algorithm_factory import AlgorithmFactory from factory.homogenous_factory ...
[ 7061, 6, 198, 41972, 319, 2758, 2310, 11, 1853, 198, 198, 31, 9800, 25, 2124, 6570, 19897, 198, 7061, 6, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 198, 6738, 4818, 993, 392, 1754, 13, 77, ...
2.79003
662
from ..wrappers.status import UpdateStatusResultWrapper from .base import HttpbinAction
[ 6738, 11485, 29988, 11799, 13, 13376, 1330, 10133, 19580, 23004, 36918, 2848, 198, 6738, 764, 8692, 1330, 367, 29281, 8800, 12502, 628 ]
4.045455
22
favorite_languages = { 'jen': 'python', 'sarah': 'c', 'edward': 'ruby', 'phil': 'python', } for name, language in favorite_languages.items(): print(name.title() + "'s favorite language is " + language.title() + ".") for name in favorite_languages.keys(): print(name.title()) friend...
[ 35200, 62, 75, 33213, 796, 1391, 198, 220, 220, 220, 705, 48796, 10354, 705, 29412, 3256, 198, 220, 220, 220, 705, 82, 23066, 10354, 705, 66, 3256, 198, 220, 220, 220, 705, 276, 904, 10354, 705, 49137, 3256, 198, 220, 220, 220, 705,...
2.786787
333
import copy import os import logging import pickle import psutil import time import threading import typing from enum import Enum from math import ceil from multiprocessing import Pool, Queue, Manager, current_process from threading import Timer _logger = logging.getLogger(__name__) # used to save all PID of workers ...
[ 11748, 4866, 198, 11748, 28686, 198, 11748, 18931, 198, 11748, 2298, 293, 198, 11748, 26692, 22602, 198, 11748, 640, 198, 11748, 4704, 278, 198, 11748, 19720, 198, 198, 6738, 33829, 1330, 2039, 388, 198, 6738, 10688, 1330, 2906, 346, 198,...
2.920502
239
""" OCCAM Copyright (c) 2011-2017, SRI International 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 source code must retain the above copyright notice, this list of con...
[ 37811, 198, 440, 4093, 2390, 628, 15069, 357, 66, 8, 2813, 12, 5539, 11, 311, 7112, 4037, 628, 220, 1439, 2489, 10395, 13, 628, 2297, 396, 3890, 290, 779, 287, 2723, 290, 13934, 5107, 11, 351, 393, 1231, 198, 17613, 11, 389, 10431, ...
2.310572
6,678
# -*- coding: utf-8 -*- ################################################################################ # GChartWrapper - v0.8 # Copyright (C) 2009 Justin Quick <justquick@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License ver...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 29113, 29113, 14468, 198, 2, 220, 402, 45488, 36918, 2848, 532, 410, 15, 13, 23, 198, 2, 220, 15069, 357, 34, 8, 3717, 220, 10799, 12029, 1279, 3137, 24209, 31, 14816,...
2.129214
9,047
import sim # seed sim.random.seed(13) # environment env = sim.simpy.Environment() # writer # packet_w = Writer("packet_", start="# id src init_time waited_time freq processed_time\n") # default values sim.tg_default_size = lambda x: 5000 sim.tg_default_dist = lambda x: 1 sim.ONU_consumption = lambda x: 15 sim.PN_co...
[ 11748, 985, 198, 198, 2, 9403, 198, 14323, 13, 25120, 13, 28826, 7, 1485, 8, 198, 198, 2, 2858, 198, 24330, 796, 985, 13, 14323, 9078, 13, 31441, 3419, 198, 198, 2, 6260, 198, 2, 19638, 62, 86, 796, 26606, 7203, 8002, 316, 62, 1...
2.439331
478
''' File to train the NIC model, based on the paper: https://www.cv-foundation.org/openaccess/content_cvpr_2015/papers/Vinyals_Show_and_Tell_2015_CVPR_paper.pdf ''' from keras.callbacks import ModelCheckpoint from keras.models import Model, load_model from keras.optimizers import Adam from keras.utils import plot_mod...
[ 7061, 6, 198, 8979, 284, 4512, 262, 45593, 2746, 11, 1912, 319, 262, 3348, 25, 198, 198, 5450, 1378, 2503, 13, 33967, 12, 42526, 13, 2398, 14, 9654, 15526, 14, 11299, 62, 33967, 1050, 62, 4626, 14, 40491, 14, 53, 3541, 874, 62, 15...
2.552036
442
import cPickle as pickle import matplotlib.pyplot as plt import numpy as np import networkx as nx
[ 11748, 269, 31686, 293, 355, 2298, 293, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 3127, 87, 355, 299, 87, 198 ]
3.0625
32
# -*- coding: utf-8 -*- """Tests for classes in _classes module.""" from inspect import getmembers, isclass import numpy as np import pandas as pd import pytest from sktime.performance_metrics.forecasting import _classes from sktime.utils._testing.series import _make_series metric_classes = getmembers(_classes, iscl...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 51, 3558, 329, 6097, 287, 4808, 37724, 8265, 526, 15931, 198, 6738, 10104, 1330, 651, 30814, 11, 318, 4871, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 1...
2.514215
809
import numpy as np import numpy.linalg as la import math if __name__ == '__main__': n = 4 matrixA = np.array([[3.738, 0.195, 0.275, 0.136], [0.519, 5.002, 0.405, 0.283], [0.306, 0.381, 4.812, 0.418], [0.272, 0.142, 0.314, 3.935]]) ...
[ 11748, 299, 32152, 355, 45941, 198, 11748, 299, 32152, 13, 75, 1292, 70, 355, 8591, 198, 11748, 10688, 628, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 299, 796, 604, 198, 220, 220, 2...
1.62642
704
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. ''' Imports ''' import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.optim.lr_scheduler import StepLR import argparse import random import numpy as np import time from tqdm import tqdm import matplotlib...
[ 2, 15069, 357, 66, 8, 2864, 11, 15127, 23929, 44680, 6234, 13, 1439, 2489, 10395, 13, 198, 198, 7061, 6, 1846, 3742, 705, 7061, 198, 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 11748, 28034, 13, 20471, 13, 45124, ...
2.525106
3,306
# # @lc app=leetcode id=226 lang=python # # [226] Invert Binary Tree # # https://leetcode.com/problems/invert-binary-tree/description/ # # algorithms # Easy (56.72%) # Total Accepted: 297.1K # Total Submissions: 522.5K # Testcase Example: '[4,2,7,1,3,6,9]' # # Invert a binary tree. # # Example: # # Input: # # # ⁠ ...
[ 2, 198, 2, 2488, 44601, 598, 28, 293, 316, 8189, 4686, 28, 24909, 42392, 28, 29412, 198, 2, 198, 2, 685, 24909, 60, 554, 1851, 45755, 12200, 198, 2, 198, 2, 3740, 1378, 293, 316, 8189, 13, 785, 14, 1676, 22143, 14, 259, 1851, 12...
2.137405
393
import os #Functions for Blackjack
[ 11748, 28686, 198, 198, 2, 24629, 2733, 329, 2619, 19650, 198, 220, 220, 220, 220 ]
2.666667
15
# Advanced Multi-Mission Operations System (AMMOS) Instrument Toolkit (AIT) # Bespoke Link to Instruments and Small Satellites (BLISS) # # Copyright 2018, by the California Institute of Technology. ALL RIGHTS # RESERVED. United States Government Sponsorship acknowledged. Any # commercial use must be negotiated with the...
[ 2, 13435, 15237, 12, 37057, 16205, 4482, 357, 2390, 44, 2640, 8, 42410, 16984, 15813, 357, 32, 2043, 8, 198, 2, 347, 9774, 2088, 7502, 284, 43953, 290, 10452, 311, 7528, 2737, 357, 9148, 16744, 8, 198, 2, 198, 2, 15069, 2864, 11, ...
3.690141
355
import json import logging import re import uuid from datetime import datetime import requests from allauth.account.models import EmailAddress from allauth.account.views import ( LoginView, LogoutView, SignupView, PasswordChangeView, PasswordSetView, PasswordResetView, PasswordResetDoneView, PasswordResetF...
[ 11748, 33918, 198, 11748, 18931, 198, 11748, 302, 198, 11748, 334, 27112, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 198, 11748, 7007, 198, 6738, 477, 18439, 13, 23317, 13, 27530, 1330, 9570, 20231, 198, 6738, 477, 18439, 13, 23317, ...
3.371226
563
""" ref: https://blog.csdn.net/chengqiuming/article/details/78601000 """ import win32gui from win32con import * wc = win32gui.WNDCLASS() wc.hbrBackground = COLOR_BTNFACE + 1 wc.hCursor = win32gui.LoadCursor(0, IDI_APPLICATION) wc.lpszClassName = "Python no Windows" wc.lpfnWndProc = WndProc reg = win32gui.RegisterCla...
[ 37811, 198, 5420, 25, 3740, 1378, 14036, 13, 6359, 32656, 13, 3262, 14, 2395, 782, 80, 1505, 278, 14, 20205, 14, 36604, 14, 3695, 41706, 830, 198, 37811, 198, 11748, 1592, 2624, 48317, 198, 6738, 1592, 2624, 1102, 1330, 1635, 628, 198...
2.197761
268
# This file is part of the Hotwire Shell project API. # Copyright (C) 2007 Colin Walters <walters@verbum.org> # 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, includin...
[ 2, 770, 2393, 318, 636, 286, 262, 6964, 21809, 17537, 1628, 7824, 13, 198, 198, 2, 15069, 357, 34, 8, 4343, 18373, 43287, 1279, 16783, 1010, 31, 332, 4435, 13, 2398, 29, 198, 198, 2, 2448, 3411, 318, 29376, 7520, 11, 1479, 286, 38...
3.700265
377
import unittest from securityheaders.checkers.csp import CSPDeprecatedDirectiveChecker, CSPReportOnlyDeprecatedDirectiveChecker if __name__ == '__main__': unittest.main()
[ 11748, 555, 715, 395, 198, 198, 6738, 2324, 50145, 13, 9122, 364, 13, 66, 2777, 1330, 327, 4303, 12156, 31023, 13470, 425, 9787, 263, 11, 327, 4303, 19100, 10049, 12156, 31023, 13470, 425, 9787, 263, 628, 198, 361, 11593, 3672, 834, 6...
3.068966
58
import pandas as pd from datetime import datetime from dateutil import parser
[ 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 3128, 22602, 1330, 30751, 628 ]
3.809524
21
#!/usr/bin/env python import os import shutil PROJECT_DIRECTORY = os.path.realpath(os.path.curdir) if __name__ == '__main__': if '{{ cookiecutter.authors_format }}' == 'Markdown': remove_file('AUTHORS.rst') remove_file('docs/source/AUTHORS.rst') elif '{{ cookiecutter.authors_format }}' == ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 11748, 28686, 198, 11748, 4423, 346, 198, 198, 31190, 23680, 62, 17931, 23988, 15513, 796, 28686, 13, 6978, 13, 5305, 6978, 7, 418, 13, 6978, 13, 66, 2799, 343, 8, 628, 628, 198, 361...
2.26
850
"""The MagicMirror integration.""" from __future__ import annotations from datetime import timedelta from aiohttp.client_exceptions import ClientConnectorError from async_timeout import timeout from voluptuous.error import Error from homeassistant.core import HomeAssistant from homeassistant.helpers.entity import D...
[ 37811, 464, 6139, 27453, 1472, 11812, 526, 15931, 198, 6738, 11593, 37443, 834, 1330, 37647, 198, 198, 6738, 4818, 8079, 1330, 28805, 12514, 198, 198, 6738, 257, 952, 4023, 13, 16366, 62, 1069, 11755, 1330, 20985, 34525, 12331, 198, 6738,...
2.344168
1,046
from qittle.types.responses import hook from .base import Base
[ 6738, 10662, 1206, 13, 19199, 13, 16733, 274, 1330, 8011, 201, 198, 6738, 764, 8692, 1330, 7308, 201, 198, 201, 198 ]
3.190476
21
"""hug/documentation.py Defines tools that automate the creation of documentation for an API build using the Hug Framework Copyright (C) 2015 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to d...
[ 37811, 71, 1018, 14, 22897, 341, 13, 9078, 198, 198, 7469, 1127, 4899, 326, 43511, 262, 6282, 286, 10314, 329, 281, 7824, 1382, 1262, 262, 12905, 25161, 198, 198, 15269, 357, 34, 8, 1853, 220, 22283, 35646, 26942, 1636, 198, 198, 5990...
2.280295
1,898
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, os.path testmodules_path = os.path.dirname(os.path.abspath(__file__)) rootpath = os.path.split(testmodules_path)[0] sys.path.append(rootpath)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 25064, 11, 28686, 13, 6978, 198, 9288, 18170, 62, 6978, 796, 28686, 13, 6978, 13, 15908, 3672, 7, 418, 13...
2.421687
83
''' No problem, just process Status: Accepted ''' ############################################################################### def main(): """Read input and print output""" result = '' for i in input(): if result: if i != result[-1]: result += i else: ...
[ 7061, 6, 198, 2949, 1917, 11, 655, 1429, 198, 198, 19580, 25, 21699, 276, 198, 7061, 6, 198, 198, 29113, 29113, 7804, 4242, 21017, 198, 198, 4299, 1388, 33529, 198, 220, 220, 220, 37227, 5569, 5128, 290, 3601, 5072, 37811, 628, 220, ...
2.884848
165
from enum import Enum
[ 6738, 33829, 1330, 2039, 388, 628, 198 ]
3.428571
7
import datetime from dateutil.parser import parse from django.db import connection from django.db.models import Min from django.db.models import Q from django.utils import timezone from rest_framework import mixins from rest_framework import pagination from rest_framework import permissions from rest_framework import ...
[ 11748, 4818, 8079, 198, 198, 6738, 3128, 22602, 13, 48610, 1330, 21136, 198, 6738, 42625, 14208, 13, 9945, 1330, 4637, 198, 6738, 42625, 14208, 13, 9945, 13, 27530, 1330, 1855, 198, 6738, 42625, 14208, 13, 9945, 13, 27530, 1330, 1195, 1...
3.413662
527
from math import sqrt from collections import deque # sort using g + h costs # implement A* seaarch algorithm # use euclidean distance to the goal node to determine the h value # use stack to retrieve elements in reverse order
[ 6738, 10688, 1330, 19862, 17034, 198, 6738, 17268, 1330, 390, 4188, 628, 220, 220, 220, 1303, 3297, 1262, 308, 1343, 289, 3484, 198, 198, 2, 3494, 317, 9, 5417, 998, 11862, 198, 198, 2, 779, 304, 36616, 485, 272, 5253, 284, 262, 306...
3.9
60
"""Provide the Comment class.""" from ...const import urljoin from ...exceptions import ClientException from ..comment_forest import CommentForest from .base import RedditBase from .mixins import InboxableMixin, ThingModerationMixin, UserContentMixin from .redditor import Redditor class Comment(RedditBase, InboxableM...
[ 37811, 15946, 485, 262, 18957, 1398, 526, 15931, 198, 6738, 2644, 9979, 1330, 19016, 22179, 198, 6738, 2644, 1069, 11755, 1330, 20985, 16922, 198, 6738, 11485, 23893, 62, 29623, 1330, 18957, 34605, 198, 6738, 764, 8692, 1330, 10750, 14881, ...
2.482067
2,593
# -*- coding: utf-8 -*- # Description: validation functions from ipaddress import (AddressValueError, NetmaskValueError, ip_address, IPv4Address, IPv6Address, ip_network, IPv4Network, IPv6Network)
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 12489, 25, 21201, 5499, 198, 198, 6738, 20966, 21975, 1330, 357, 20231, 11395, 12331, 11, 3433, 27932, 11395, 12331, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, ...
2.293578
109
from nekumo.api.config import QuickStart from nekumo.api.nodes import Dir, File, Node, Image, Video __author__ = 'nekmo' stanza_classes = [ # Este listado se recorre para determinar el tipo de clase mejor a usar # con un nodo. Se usa un método estático is_capable para determinarlo. # Por ejemplo, tendrem...
[ 6738, 497, 74, 43712, 13, 15042, 13, 11250, 1330, 12029, 10434, 198, 6738, 497, 74, 43712, 13, 15042, 13, 77, 4147, 1330, 36202, 11, 9220, 11, 19081, 11, 7412, 11, 7623, 198, 198, 834, 9800, 834, 796, 705, 710, 74, 5908, 6, 628, 1...
2.460227
176
import time import pygame pygame.mixer.init() alarm = pygame.mixer.Sound("alarm_ding.ogg") alarm_len = alarm.get_length() minutes = int(input ("Minutes:"))*60 seconds = int(input("Seconds:")) timer = minutes + seconds for i in range(timer): print("", str(timer - i), end="\r") time.sleep(1) alarm.play() print("t...
[ 11748, 640, 198, 11748, 12972, 6057, 198, 9078, 6057, 13, 19816, 263, 13, 15003, 3419, 198, 282, 1670, 796, 12972, 6057, 13, 19816, 263, 13, 21369, 7203, 282, 1670, 62, 12083, 13, 10332, 4943, 198, 282, 1670, 62, 11925, 796, 10436, 13...
2.602941
136
#################################3################################################################## # Name: Pygame Snake Experiement # Purpose: Make a simple pygame game to get a handle on PyGame # Date: 2013/12/22 # Programmer: Toben "Littlefoo" "Narcolapser" Archer # Version: 0.1 ##################################...
[ 29113, 2, 18, 29113, 29113, 2235, 198, 2, 197, 5376, 25, 197, 197, 20519, 6057, 16705, 8170, 72, 972, 198, 2, 197, 30026, 3455, 25, 197, 12050, 257, 2829, 12972, 6057, 983, 284, 651, 257, 5412, 319, 9485, 8777, 198, 2, 197, 10430, ...
2.752542
590
#!/usr/bin/env python3 # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 15069, 33160, 3012, 11419, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, ...
2.968935
676
# amounra 0513 : http://www.aumhaa.com from __future__ import with_statement import Live import math """ _Framework files """ from _Framework.ButtonElement import ButtonElement # Class representing a button a the controller from _Framework.ButtonMatrixElement import ButtonMatrixElement # Class representing a 2-dimen...
[ 2, 716, 977, 430, 8870, 1485, 1058, 2638, 1378, 2503, 13, 26043, 3099, 64, 13, 785, 628, 198, 6738, 11593, 37443, 834, 1330, 351, 62, 26090, 198, 11748, 7547, 198, 11748, 10688, 198, 198, 37811, 4808, 21055, 6433, 3696, 37227, 198, 67...
4.218117
839
from dataclasses import dataclass from typing import Optional from flask_datadog.generator import endpoint_util from flask_datadog.shared.datadog_constants import \ MonitorType, \ MonitorSpec @dataclass(frozen=True) @dataclass(frozen=True) class DatadogMonitor: """Represents a DataDog Monitor""" ...
[ 6738, 4818, 330, 28958, 1330, 4818, 330, 31172, 198, 6738, 19720, 1330, 32233, 198, 198, 6738, 42903, 62, 19608, 324, 519, 13, 8612, 1352, 1330, 36123, 62, 22602, 198, 6738, 42903, 62, 19608, 324, 519, 13, 28710, 13, 19608, 324, 519, ...
2.099213
3,810