content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#!/usr/bin/env python3
"""Runs kb-stopwatch."""
from kbstopwatch.main import main
# Run it
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
10987,
82,
47823,
12,
11338,
8340,
526,
15931,
198,
198,
6738,
47823,
11338,
8340,
13,
12417,
1330,
1388,
628,
198,
2,
5660,
340,
198,
12417,
3419,
198
] | 2.657895 | 38 |
#!/usr/bin/env python
# encoding: utf-8
import sys, os
import numpy as np
import bisect
import scipy.io
import bisect
import math
import h5py
from nltk.corpus import wordnet as wn
from nltk.corpus import wordnet_ic
from basic.constant import ROOT_PATH
from basic.common import makedirsforfile, checkToSkip, printStatus... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
11748,
25064,
11,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
47457,
478,
198,
11748,
629,
541,
88,
13,
952,
198,
11748,
47457,
4... | 2.884615 | 208 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
from numpy.random import RandomState
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import random_ops
import random
""" Quarternion layers
... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
... | 2.243561 | 3,572 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: hfc/protos/token/prover.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import refl... | [
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
289,
16072,
14,
11235,
418,
14,
30001,
14,
1676,
332,
13,
1676,
1462,
198,
198,
11748,
25064,
198,
62,
65,
28,
17597,
13,
9641,
62,
10951... | 2.442633 | 17,545 |
import json
import requests
from instagram_scraper.constants import BASE_URL, STORIES_UA, LOGIN_URL, LOGOUT_URL
CHROME_WIN_UA = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36'
| [
11748,
33918,
198,
198,
11748,
7007,
198,
198,
6738,
916,
6713,
62,
1416,
38545,
13,
9979,
1187,
1330,
49688,
62,
21886,
11,
46366,
11015,
62,
34970,
11,
41605,
1268,
62,
21886,
11,
41605,
12425,
62,
21886,
198,
198,
37846,
13649,
62,
... | 2.541667 | 96 |
# Determining interface details with netfaces library
# This script uses a number of functions to accomplish specific tasks
# including get_networks, get_addresses, get_gateways and get_interfaces
import netifaces
import sys
try:
import netifaces
except:
sys.exit("[!] Install the netifaces library: pip install... | [
2,
360,
13221,
278,
7071,
3307,
351,
2010,
32186,
5888,
198,
2,
770,
4226,
3544,
257,
1271,
286,
5499,
284,
9989,
2176,
8861,
198,
2,
1390,
651,
62,
3262,
5225,
11,
651,
62,
2860,
16746,
11,
651,
62,
10494,
1322,
290,
651,
62,
384... | 3.747475 | 198 |
from helpers import functions
from flask import Flask, request, session, url_for, redirect, \
render_template, abort, g, flash, _app_ctx_stack
from werkzeug import check_password_hash, generate_password_hash
def login():
"""Logs the user in."""
if g.user:
return redirect(functions.url_for('/'))
... | [
6738,
49385,
1330,
5499,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
6246,
11,
19016,
62,
1640,
11,
18941,
11,
3467,
198,
220,
220,
220,
220,
8543,
62,
28243,
11,
15614,
11,
308,
11,
7644,
11,
4808,
1324,
62,
49464,
62,
25558,
198,... | 2.438017 | 484 |
#Embedded file name: /Users/versonator/Hudson/live/Projects/AppLive/Resources/MIDI Remote Scripts/MackieControl/ChannelStripController.py
from itertools import chain
from .MHControlComponent import *
from _Generic.Devices import *
class ChannelStripController(MHControlComponent):
"""
Controls all channel-... | [
2,
31567,
47238,
2393,
1438,
25,
1220,
14490,
14,
49589,
1352,
14,
39,
463,
1559,
14,
12583,
14,
16775,
82,
14,
4677,
18947,
14,
33236,
14,
44,
2389,
40,
21520,
12327,
82,
14,
44,
441,
494,
15988,
14,
29239,
1273,
5528,
22130,
13,
... | 2.147581 | 13,125 |
nome = str(input('Digite o seu nome: '))
nom = nome.title()
print('Silva' in nom) | [
77,
462,
796,
965,
7,
15414,
10786,
19511,
578,
267,
384,
84,
299,
462,
25,
705,
4008,
198,
26601,
796,
299,
462,
13,
7839,
3419,
198,
4798,
10786,
15086,
6862,
6,
287,
4515,
8
] | 2.382353 | 34 |
print(insertionSort([55,3,2,5,6,75,4])) | [
201,
198,
201,
198,
201,
198,
4798,
7,
28463,
295,
42758,
26933,
2816,
11,
18,
11,
17,
11,
20,
11,
21,
11,
2425,
11,
19,
60,
4008
] | 1.666667 | 27 |
#!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""
"""
#end_pymotw_header
import argparse
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group()
group.add_argument('-a', action='store_true')
group.add_argument('-b', action='store_true'... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
2,
198,
2,
15069,
357,
66,
8,
3050,
15115,
5783,
9038,
13,
220,
1439,
2489,
10395,
13,
198,
2,
198,
37811,
198,
37811,
198,
198,
2,
437,
... | 2.8 | 125 |
#!/usr/bin/env python3
# === IMPORTS ===
import logging
import os
from flask import Flask
from inovonics.cloud.datastore import InoRedis
from inovonics.cloud.oauth import InoOAuth2Provider, oauth_register_handlers
from inovonics.cloud.oauth import OAuthClients, OAuthClient, OAuthUsers, OAuthUser
# === GLOBALS ===
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
24844,
30023,
33002,
24844,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
6738,
42903,
1330,
46947,
198,
198,
6738,
287,
709,
38530,
13,
17721,
13,
19608,
459,
382,
1330,
... | 2.555882 | 340 |
from otree.api import Currency as c, currency_range
from . import views
from ._builtin import Bot
from .models import Constants
from otree.api import SubmissionMustFail
| [
6738,
267,
21048,
13,
15042,
1330,
20113,
355,
269,
11,
7395,
62,
9521,
198,
6738,
764,
1330,
5009,
198,
6738,
47540,
18780,
259,
1330,
18579,
198,
6738,
764,
27530,
1330,
4757,
1187,
198,
6738,
267,
21048,
13,
15042,
1330,
42641,
34320... | 3.866667 | 45 |
from transferfile import TransferFactory
from pathlib import Path
| [
6738,
4351,
7753,
1330,
20558,
22810,
198,
6738,
3108,
8019,
1330,
10644,
628
] | 5.153846 | 13 |
'''
Socket.IO server for testing
CLI:
python -m watchgod server.main [aiohttp|sanic|tornado|asgi]
Test results:
| connect | disconnect | event | background_task | Ctrl+C
---------+---------+------------+-------+-----------------|--------
aiohttp | O | O | O | X ... | [
7061,
6,
201,
198,
39105,
13,
9399,
4382,
329,
4856,
201,
198,
201,
198,
5097,
40,
25,
201,
198,
220,
21015,
532,
76,
2342,
25344,
4382,
13,
12417,
685,
64,
952,
4023,
91,
12807,
291,
91,
45910,
4533,
91,
292,
12397,
60,
201,
198,... | 2.0375 | 400 |
import cv2
video_file_name = ""
if __name__ == '__main__':
FrameCapture(video_file_name)
| [
11748,
269,
85,
17,
220,
198,
198,
15588,
62,
7753,
62,
3672,
796,
13538,
198,
220,
220,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
220,
198,
220,
220,
220,
25184,
49630,
7,
15588,
62,
7753,
62,
3672,
8,
198
] | 2.302326 | 43 |
# Copyright 2016 Medical Research Council Harwell.
#
# 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... | [
2,
15069,
1584,
8366,
4992,
4281,
2113,
4053,
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,
1... | 2.176957 | 5,199 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
# Maintainer: Jonathan Lange <jml@twistedmatrix.com>
import errno, sys, os, re, StringIO
from twisted.internet.utils import suppressWarnings
from twisted.python import failure
from twisted.trial import unittest, runner, reporter, util... | [
2,
15069,
357,
66,
8,
5878,
12,
15724,
40006,
24936,
46779,
13,
198,
2,
4091,
38559,
24290,
329,
3307,
13,
198,
2,
198,
2,
337,
2913,
10613,
25,
11232,
47579,
1279,
73,
4029,
31,
4246,
6347,
6759,
8609,
13,
785,
29,
628,
198,
1174... | 3.436937 | 222 |
# Import Flask app object from project folder (For python this means from the __init__.py file)
from project import app
# Run flask app with debug on and listening on port 8000
app.run(
debug=True,
port=8000
) | [
2,
17267,
46947,
598,
2134,
422,
1628,
9483,
357,
1890,
21015,
428,
1724,
422,
262,
11593,
15003,
834,
13,
9078,
2393,
8,
198,
6738,
1628,
1330,
598,
198,
198,
2,
5660,
42903,
598,
351,
14257,
319,
290,
8680,
319,
2493,
38055,
198,
... | 3.460317 | 63 |
# Event: LCCS Python Fundamental Skills Workshop
# Date: May 2018
# Author: Joe English, PDST
# eMail: computerscience@pdst.ie
# Purpose: Prediction exercise
fruits = ['Strawberry', 'Lemon', 'Orange', 'Raspberry', 'Cherry']
print(fruits[0])
print(fruits[3])
print(fruits[2])
print(fruits[len(fruits)-1])
pr... | [
2,
8558,
25,
406,
4093,
50,
11361,
49983,
20389,
26701,
201,
198,
2,
7536,
25,
1737,
2864,
201,
198,
2,
6434,
25,
5689,
3594,
11,
14340,
2257,
201,
198,
2,
304,
25804,
25,
9061,
4234,
31,
30094,
301,
13,
494,
201,
198,
2,
32039,
... | 2.687023 | 262 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 4 07:43:40 2020
@author: lukemcculloch
"""
import numpy as np
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
7031,
2365,
220,
604,
8753,
25,
3559,
25,
1821,
12131,
198,
198,
31,
9800,
25,
300,
4649,... | 2 | 76 |
from .vsr import VERSION
__version__ = VERSION
__author__ = 'Sameera Sandaruwan'
__author_email__ = 'basameera@protonmail.com' | [
6738,
764,
14259,
81,
1330,
44156,
2849,
198,
834,
9641,
834,
796,
44156,
2849,
198,
834,
9800,
834,
796,
705,
30556,
8607,
3837,
11493,
8149,
6,
198,
834,
9800,
62,
12888,
834,
796,
705,
12093,
480,
8607,
31,
1676,
1122,
4529,
13,
... | 2.863636 | 44 |
from django.test import LiveServerTestCase
from selenium import webdriver
from django.urls import reverse
from django.utils.translation import activate, gettext_lazy as _
from .creation_utils import create_user, create_post
from simpleblog.models import Post
if __name__ == '__main__':
unittest.main()
| [
6738,
42625,
14208,
13,
9288,
1330,
7547,
10697,
14402,
20448,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
15155,
11,
651,
5239,
... | 3.411111 | 90 |
# O(n) time | O(n) space
# O(n) time | O(1) space
| [
2,
440,
7,
77,
8,
640,
930,
440,
7,
77,
8,
2272,
198,
198,
2,
440,
7,
77,
8,
640,
930,
440,
7,
16,
8,
2272,
198
] | 1.888889 | 27 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#! 强制默认编码为utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import urllib, urllib2, json, time
from pprint import pprint
from pdb import set_trace
import requests
from lxml import html
from alfred.feedback import Feedback
from config import service, addword, ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
0,
10263,
120,
118,
26344,
114,
165,
119,
246,
164,
106,
97,
163,
120,
244,
163,
254,
223,
10310,
118,
40477,
12... | 2.265306 | 196 |
ODL_IP = "127.0.0.1"
ODL_PORT = "8181"
ODL_USER = "admin"
ODL_PASS = "admin"
| [
3727,
43,
62,
4061,
796,
366,
16799,
13,
15,
13,
15,
13,
16,
1,
198,
3727,
43,
62,
15490,
796,
366,
23,
27057,
1,
198,
3727,
43,
62,
29904,
796,
366,
28482,
1,
198,
3727,
43,
62,
47924,
796,
366,
28482,
1,
628
] | 1.813953 | 43 |
import requests
from nova_dveri_ru.data import USER_AGENT
if __name__ == '__main__':
url = 'https://nova-dveri.ru/mezhkomnatnye-dveri/ehkoshpon/il%20doors/dver-galleya-07-chern-yasen-svetlyj'
out_html_file = 'galleya-07-chern-yasen-svetlyj.html'
save_html_code(url, out_html_file)
| [
11748,
7007,
198,
198,
6738,
645,
6862,
62,
67,
332,
72,
62,
622,
13,
7890,
1330,
1294,
1137,
62,
4760,
3525,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
19016,
796,
705,
5450,
1378,
... | 2.048276 | 145 |
# Copyright 2021 Jakub Kuczys (https://github.com/jack1142)
#
# 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 applicab... | [
2,
15069,
33448,
25845,
549,
509,
1229,
89,
893,
357,
5450,
1378,
12567,
13,
785,
14,
19650,
1157,
3682,
8,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407... | 3.047292 | 1,311 |
from dataclasses import dataclass
from profit.types.blockchain_format.sized_bytes import bytes32
from profit.util.ints import uint32
from profit.util.streamable import Streamable, streamable
@dataclass(frozen=True)
@streamable
| [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
198,
6738,
7630,
13,
19199,
13,
9967,
7983,
62,
18982,
13,
13982,
62,
33661,
1330,
9881,
2624,
198,
6738,
7630,
13,
22602,
13,
29503,
1330,
20398,
2624,
198,
6738,
7630,
13,
22602,
... | 3.432836 | 67 |
# Generated by h2py from \mssdk\include\winnt.h
APPLICATION_ERROR_MASK = 536870912
ERROR_SEVERITY_SUCCESS = 0
ERROR_SEVERITY_INFORMATIONAL = 1073741824
ERROR_SEVERITY_WARNING = -2147483648
ERROR_SEVERITY_ERROR = -1073741824
MINCHAR = 128
MAXCHAR = 127
MINSHORT = 32768
MAXSHORT = 32767
MINLONG = -2147483648
... | [
2,
2980,
515,
416,
289,
17,
9078,
422,
3467,
76,
824,
34388,
59,
17256,
59,
5404,
429,
13,
71,
201,
198,
201,
198,
2969,
31484,
6234,
62,
24908,
62,
31180,
42,
796,
642,
27412,
31495,
1065,
201,
198,
24908,
62,
5188,
5959,
9050,
6... | 1.877983 | 17,473 |
# -*- encoding: utf-8 -*-
""" Exceptions for EsiPy related errors """
class APIException(Exception):
""" Exception for SSO related errors """
| [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
1475,
11755,
329,
8678,
72,
20519,
3519,
8563,
37227,
201,
198,
201,
198,
201,
198,
4871,
7824,
16922,
7,
16922,
2599,
201,
198,
220,
220,
220,
37227,
35528,... | 2.961538 | 52 |
# coding=utf-8
# Author: Jianghan LI
# Question: 599.Minimum_Index_Sum_of_Two_Lists
# Date: 2017-05-30, 0 wrong try
from collections import Counter
s = Solution()
print s.findRestaurant(["Shogun", "Tapioca Express", "Burger King", "KFC"], ["KFC", "Shogun", "Burger King"])
| [
2,
19617,
28,
40477,
12,
23,
198,
2,
6434,
25,
40922,
6064,
24653,
198,
2,
18233,
25,
642,
2079,
13,
44046,
62,
15732,
62,
13065,
62,
1659,
62,
7571,
62,
43,
1023,
198,
2,
7536,
25,
2177,
12,
2713,
12,
1270,
11,
657,
2642,
1949,... | 2.742574 | 101 |
"""Test awesomeversion."""
import json
import pytest
from awesomeversion import (
AwesomeVersion,
AwesomeVersionStrategy,
AwesomeVersionStrategyException,
)
def test_awesomeversion():
"""Test awesomeversion."""
version = AwesomeVersion("2020.12.1")
assert not version.beta
version = Awes... | [
37811,
14402,
7427,
9641,
526,
15931,
198,
11748,
33918,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
7427,
9641,
1330,
357,
198,
220,
220,
220,
25020,
14815,
11,
198,
220,
220,
220,
25020,
14815,
13290,
4338,
11,
198,
220,
220,
220,
... | 2.646931 | 1,385 |
# Generated by Django 2.2.5 on 2019-11-02 11:35
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
20,
319,
13130,
12,
1157,
12,
2999,
1367,
25,
2327,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import re
import os
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
import csv
from product_spiders.items import Product, ProductLoader
| [
11748,
302,
198,
11748,
28686,
198,
198,
6738,
15881,
88,
13,
2777,
1304,
1330,
7308,
41294,
198,
6738,
15881,
88,
13,
19738,
273,
1330,
367,
20369,
55,
15235,
17563,
273,
198,
6738,
15881,
88,
13,
4023,
1330,
19390,
11,
367,
20369,
3... | 3.433333 | 90 |
# -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we as... | [
2,
532,
9,
12,
21015,
532,
9,
12,
198,
198,
2,
770,
3788,
373,
4635,
416,
399,
8808,
11,
281,
4086,
286,
262,
471,
13,
50,
13,
1230,
11,
198,
2,
290,
416,
14195,
318,
407,
2426,
284,
6634,
287,
262,
1578,
1829,
13,
198,
2,
3... | 2.675607 | 783 |
# Copyright 2021, 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
2,
15069,
33448,
11,
3012,
11419,
13,
1439,
2489,
10395,
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,
1... | 2.977642 | 984 |
# -*- coding: utf-8 -*-
# Copyright 2012 Loris Corazza, Sakis Christakidis
#
# 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
#
# U... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
220,
220,
15069,
2321,
26068,
271,
2744,
1031,
4496,
11,
13231,
271,
1951,
461,
29207,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
... | 3.382075 | 212 |
"""Initial migrate
Revision ID: 8580b5c0888c
Revises:
Create Date: 2017-11-02 23:42:58.243681
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8580b5c0888c'
down_revision = None
branch_labels = None
depends_on = None
| [
37811,
24243,
32492,
198,
198,
18009,
1166,
4522,
25,
7600,
1795,
65,
20,
66,
2919,
3459,
66,
198,
18009,
2696,
25,
220,
198,
16447,
7536,
25,
2177,
12,
1157,
12,
2999,
2242,
25,
3682,
25,
3365,
13,
1731,
2623,
6659,
198,
198,
37811... | 2.607477 | 107 |
from ._base import *
from .soccer import SoccerModel
from .soccerObjectDetector import SoccerObjectDetector
| [
6738,
47540,
8692,
1330,
1635,
198,
6738,
764,
35634,
2189,
1330,
15872,
17633,
198,
6738,
764,
35634,
2189,
10267,
11242,
9250,
1330,
15872,
10267,
11242,
9250,
198
] | 4 | 27 |
# Compute potential scale reduction factor (Rhat) using rhat function of kanga, which is rhat of arviz
# %% Load packages
import arviz as az
import numpy as np
# %% Define function for computing univariate Rhat based on arviz
# x is a numpy array of 3 dimensions, (chain, MC iteration, parameter)
# %% Read chains
... | [
2,
3082,
1133,
2785,
5046,
7741,
5766,
357,
49,
5183,
8,
1262,
374,
5183,
2163,
286,
479,
16484,
11,
543,
318,
374,
5183,
286,
610,
85,
528,
198,
198,
2,
43313,
8778,
10392,
198,
198,
11748,
610,
85,
528,
355,
35560,
198,
11748,
2... | 2.982833 | 233 |
"""Helpers: Information: read_hacs_manifest."""
import json
# pylint: disable=missing-docstring
import os
from custom_components.hacs.helpers.functions.information import read_hacs_manifest
from custom_components.hacs.share import get_hacs
| [
37811,
12621,
19276,
25,
6188,
25,
1100,
62,
71,
16436,
62,
805,
8409,
526,
15931,
198,
11748,
33918,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
45688,
12,
15390,
8841,
198,
11748,
28686,
198,
198,
6738,
2183,
62,
5589,
3906,
13,
7... | 3.128205 | 78 |
"""Pieces used in Capture The Flag (Ctf) game."""
| [
37811,
48223,
728,
973,
287,
31793,
383,
19762,
357,
34,
27110,
8,
983,
526,
15931,
628,
198
] | 3.058824 | 17 |
"""The main idea of CE (Cross Entropy) is to maintain a distribution
of possible solution, and update this distribution accordingly.
Preliminary investigation showed that applicability of CE to RL problems
is restricted severly by the phenomenon that the distribution concentrates to
a single point too fast.
To preven... | [
37811,
464,
1388,
2126,
286,
18671,
357,
21544,
7232,
28338,
8,
318,
284,
5529,
257,
6082,
198,
1659,
1744,
4610,
11,
290,
4296,
428,
6082,
16062,
13,
198,
198,
47,
2411,
38429,
3645,
3751,
326,
2161,
1799,
286,
18671,
284,
45715,
276... | 2.869192 | 1,399 |
"""
Michael duPont - michael@mdupont.com
avwx_api.views - Routes and views for the Quart application
"""
# pylint: disable=W0702
# library
from quart import Response, jsonify
# module
from avwx_api import app
# Static Web Pages
@app.route("/")
@app.route("/home")
async def home() -> Response:
"""Returns stati... | [
37811,
198,
13256,
7043,
48039,
532,
285,
40302,
31,
76,
646,
79,
756,
13,
785,
198,
615,
49345,
62,
15042,
13,
33571,
532,
39602,
274,
290,
5009,
329,
262,
48748,
3586,
198,
37811,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
54,
... | 2.904437 | 293 |
""" Base mutual information estimators. """
from numpy import sum, sqrt, isnan, exp, mean, eye, ones, dot, cumsum, \
hstack, newaxis, maximum, prod, abs, arange, log
from numpy.linalg import norm
from scipy.spatial.distance import pdist, squareform
from scipy.special import factorial
from scipy.linal... | [
37811,
7308,
13584,
1321,
3959,
2024,
13,
37227,
198,
198,
6738,
299,
32152,
1330,
2160,
11,
19862,
17034,
11,
2125,
272,
11,
1033,
11,
1612,
11,
4151,
11,
3392,
11,
16605,
11,
269,
5700,
388,
11,
3467,
198,
220,
220,
220,
220,
220,... | 2.048492 | 13,198 |
#! python3
print("Task 17.3")
import requests
from plotly.graph_objs import Bar
from plotly import offline
def get_response():
"""Make an api call, and return the response."""
url = 'https://api.github.com/search/repositories?q=language:python&sort=stars'
headers = {'Accept': 'application/vnd.github.v3+... | [
2,
0,
21015,
18,
198,
198,
4798,
7203,
25714,
1596,
13,
18,
4943,
198,
198,
11748,
7007,
198,
198,
6738,
7110,
306,
13,
34960,
62,
672,
8457,
1330,
2409,
198,
6738,
7110,
306,
1330,
18043,
198,
198,
4299,
651,
62,
26209,
33529,
198,... | 2.252234 | 1,007 |
"""Custom exceptions for this package"""
class JerseyError(Exception):
"""Basic exception for this package"""
pass
| [
37811,
15022,
13269,
329,
428,
5301,
37811,
198,
198,
4871,
8221,
12331,
7,
16922,
2599,
198,
220,
220,
220,
37227,
26416,
6631,
329,
428,
5301,
37811,
198,
220,
220,
220,
1208,
198
] | 3.875 | 32 |
# influenced by https://www.reddit.com/r/adventofcode/comments/a3kr4r/2018_day_6_solutions/eb7385m/
import itertools
from collections import defaultdict, Counter
if __name__ == "__main__":
with open("6.txt") as f:
points = f.readlines()
points = [tuple(int(i) for i in l.split(",")) for l in points... | [
2,
12824,
416,
3740,
1378,
2503,
13,
10748,
13,
785,
14,
81,
14,
324,
1151,
1659,
8189,
14,
15944,
14,
64,
18,
38584,
19,
81,
14,
7908,
62,
820,
62,
21,
62,
82,
14191,
14,
1765,
22,
27203,
76,
14,
198,
198,
11748,
340,
861,
10... | 2.571429 | 161 |
"""Grammar and methods for parsing the configuration file"""
from .printing import PybnfError, print1
from .config import Configuration
from string import punctuation
import logging
import pyparsing as pp
import re
logger = logging.getLogger(__name__)
numkeys_int = ['verbosity', 'parallel_count', 'delete_old_fi... | [
37811,
38,
859,
3876,
290,
5050,
329,
32096,
262,
8398,
2393,
37811,
628,
198,
6738,
764,
4798,
278,
1330,
9485,
9374,
69,
12331,
11,
3601,
16,
198,
6738,
764,
11250,
1330,
28373,
198,
198,
6738,
4731,
1330,
21025,
2288,
198,
198,
117... | 2.159463 | 2,013 |
from typing import Dict, Any
import torch
from torch import nn
from torch.utils.data import DataLoader
from torch import optim
from torch.optim.lr_scheduler import _LRScheduler
from ..core.callback import Callback
from ..core.state import State
from ..utils.torch import get_available_device
| [
6738,
19720,
1330,
360,
713,
11,
4377,
198,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
6738,
28034,
1330,
6436,
198,
6738,
28034,
13,
40085,
13,
14050,
62,
1416,
... | 3.641975 | 81 |
import numpy as np
import pandas as pd
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import requests
import time
import os
from selenium.webdriver.common.by import By
import re
import time
from sklearn.linear_model import LinearRegression
from sklearn.model... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
13083,
... | 2.460406 | 3,397 |
import sys
feature_map_basic = {
"avg_length":"the average length",
"avg_basic_words":"the ratio of basic words (pre-defied by a dictionary)",
"avg_lexical_richness":"the lexical diversity",
"avg_gender_bias_word_male":"the average ratio of male words",
"avg_gender_bias_word_female":"the average ... | [
11748,
25064,
628,
198,
198,
30053,
62,
8899,
62,
35487,
796,
1391,
198,
220,
220,
220,
366,
615,
70,
62,
13664,
2404,
1169,
2811,
4129,
1600,
198,
220,
220,
220,
366,
615,
70,
62,
35487,
62,
10879,
2404,
1169,
8064,
286,
4096,
2456... | 3.032073 | 873 |
from typing import List
from wt.ids import BaseId
from wt.fields.links._obj import Link
| [
6738,
19720,
1330,
7343,
198,
198,
6738,
266,
83,
13,
2340,
1330,
7308,
7390,
198,
6738,
266,
83,
13,
25747,
13,
28751,
13557,
26801,
1330,
7502,
628
] | 3.333333 | 27 |
fileName = 'test.txt'
linebreak = '\n'
items = [['a,99,22'], ['b,34,dd'], ['c,5,21']]
writeItemsToFile(items)
items = getItemsFromFile()
print(items)
| [
7753,
5376,
796,
705,
9288,
13,
14116,
6,
198,
1370,
9032,
796,
705,
59,
77,
6,
198,
198,
23814,
796,
16410,
6,
64,
11,
2079,
11,
1828,
6,
4357,
37250,
65,
11,
2682,
11,
1860,
6,
4357,
37250,
66,
11,
20,
11,
2481,
6,
11907,
19... | 2.253731 | 67 |
__________________________________________________________________________________________________
sample 56 ms submission
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
___________________________________... | [
27193,
10221,
834,
198,
39873,
7265,
13845,
14498,
198,
2,
30396,
329,
257,
13934,
5509,
10139,
13,
198,
2,
1398,
12200,
19667,
25,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
2124,
2599,
198,
2,
220,
220,
220,
... | 3.884393 | 173 |
from epics import caput, caget
from math import inf, nan
from IEX_29id.utils.exp import CheckBranch
from IEX_29id.utils.misc import read_dict
from bluesky import plan_stubs as bps
import logging
from ophyd import EpicsMotor, EpicsSignal, PVPositionerPC, EpicsSignalRO, Signal
from ophyd import Component, Device
f... | [
6738,
2462,
873,
1330,
1451,
315,
11,
269,
363,
316,
198,
6738,
10688,
1330,
1167,
11,
15709,
198,
6738,
314,
6369,
62,
1959,
312,
13,
26791,
13,
11201,
1330,
6822,
33,
25642,
198,
6738,
314,
6369,
62,
1959,
312,
13,
26791,
13,
4437... | 1.809721 | 2,654 |
import os
import unittest
from vcr_unittest import VCRTestCase
import getnet
from getnet import NotFound
from getnet.services.base import ResponseList
from getnet.services.customers import Service, Customer
from tests.getnet.services.customers.test_customer import sample
if __name__ == "__main__":
unittest.mai... | [
11748,
28686,
198,
11748,
555,
715,
395,
198,
198,
6738,
410,
6098,
62,
403,
715,
395,
1330,
569,
9419,
14402,
20448,
198,
198,
11748,
651,
3262,
198,
6738,
651,
3262,
1330,
1892,
21077,
198,
6738,
651,
3262,
13,
30416,
13,
8692,
1330... | 3.272727 | 99 |
import psutil
import json
mem = psutil.virtual_memory()
result = { "_Total": mem.total }
print(json.dumps(result))
| [
11748,
26692,
22602,
198,
11748,
33918,
198,
198,
11883,
796,
26692,
22602,
13,
32844,
62,
31673,
3419,
198,
20274,
796,
1391,
45434,
14957,
1298,
1066,
13,
23350,
1782,
198,
4798,
7,
17752,
13,
67,
8142,
7,
20274,
4008,
198
] | 2.974359 | 39 |
import typing
from random import randint, random as random_range
from PIL import ImageFilter, Image
from pixelsort.sorting import lightness
def edge(image: Image.Image, lower_threshold: float, **_) -> typing.List[typing.List[int]]:
"""Performs an edge detection, which is used to define intervals. Tweak threshol... | [
11748,
19720,
198,
6738,
4738,
1330,
43720,
600,
11,
4738,
355,
4738,
62,
9521,
198,
198,
6738,
350,
4146,
1330,
7412,
22417,
11,
7412,
198,
198,
6738,
17848,
419,
13,
82,
24707,
1330,
1657,
1108,
628,
198,
4299,
5743,
7,
9060,
25,
... | 2.361144 | 1,678 |
import django
from django.conf import settings
from django.utils.decorators import classonlymethod
from django.views.generic import CreateView, UpdateView, DeleteView
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.http.response import JsonResponse
from django.template.response import Templat... | [
11748,
42625,
14208,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
26791,
13,
12501,
273,
2024,
1330,
1398,
8807,
24396,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
13610,
7680,
11,
10133,
7680,
11,... | 3.55625 | 160 |
print("Enter 'q' at any time to quit.\n")
while True:
try:
x = input("\nGive me a number: ")
if x == 'q':
break
x = int(x)
y = input("Give me another number: ")
if y == 'q':
break
y = int(y)
except ValueError:
print("Sorry, I r... | [
4798,
7203,
17469,
705,
80,
6,
379,
597,
640,
284,
11238,
13,
59,
77,
4943,
198,
198,
4514,
6407,
25,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
796,
5128,
7203,
59,
77,
23318,
502,
257,
1271,
25... | 1.965665 | 233 |
#!/usr/bin/env python3
import sys
import cdsapi
year= sys.argv[1]
month= sys.argv[2]
c = cdsapi.Client()
c.retrieve(
'efas-historical',
{
'format': 'grib',
'origin': 'ecmwf',
'simulation_version': 'version_3_5',
'variable'... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
25064,
198,
11748,
269,
9310,
15042,
198,
1941,
28,
25064,
13,
853,
85,
58,
16,
60,
198,
8424,
28,
25064,
13,
853,
85,
58,
17,
60,
198,
198,
66,
796,
269,
9310,
15042,
... | 1.320151 | 1,062 |
from . import settings
class Block:
"""Minecraft PI block description. Can be sent to Minecraft.setBlock/s"""
def __iter__(self):
"""Allows a Block to be sent whenever id [and data] is needed"""
if self.nbt is not None:
return iter((self.id, self.data, self.nbt))
else:
... | [
6738,
764,
1330,
6460,
198,
198,
4871,
9726,
25,
198,
220,
220,
220,
37227,
39194,
30434,
2512,
6764,
13,
1680,
307,
1908,
284,
24609,
13,
2617,
12235,
14,
82,
37811,
628,
220,
220,
220,
825,
11593,
2676,
834,
7,
944,
2599,
198,
220... | 1.844175 | 3,966 |
#Write a function shorten(text, n) to process a text,
# omitting the n most frequently occurring words of the text.
# How readable is it?
import nltk
def shorten(text, n):
"""Delete the most frequent n words from a text (list of words)"""
assert isinstance(text, list), "The text should be a list of words"
... | [
2,
16594,
257,
2163,
45381,
7,
5239,
11,
299,
8,
284,
1429,
257,
2420,
11,
198,
2,
267,
16138,
262,
299,
749,
6777,
14963,
2456,
286,
262,
2420,
13,
198,
2,
1374,
31744,
318,
340,
30,
198,
11748,
299,
2528,
74,
198,
198,
4299,
4... | 2.825279 | 807 |
import time
from config import singleton, Logger
from elasticsearch import Elasticsearch
from elasticsearch.helpers import bulk
from datetime import datetime
from numpy import long
log = Logger().logger
@singleton
| [
11748,
640,
201,
198,
6738,
4566,
1330,
2060,
1122,
11,
5972,
1362,
201,
198,
6738,
27468,
12947,
1330,
48567,
12947,
201,
198,
6738,
27468,
12947,
13,
16794,
364,
1330,
11963,
201,
198,
6738,
4818,
8079,
1330,
4818,
8079,
201,
198,
673... | 3.267606 | 71 |
from django.urls import reverse, reverse_lazy
from django.utils.translation import gettext_lazy as _
from arctic.generics import (
CreateView,
DeleteView,
ListView,
UpdateView,
)
from .forms import {{ camel_case_app_name }}Form
from .models import {{ camel_case_app_name }}
class {{ camel_case_app_na... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
11,
9575,
62,
75,
12582,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
355,
4808,
198,
198,
6738,
610,
11048,
13,
8612,
873,
1330,
357,
198,
220,
220,
22... | 2.61563 | 627 |
import re
from base64 import urlsafe_b64encode
from os import urandom
from typing import cast
from unittest import TestCase
from unittest.mock import MagicMock
from ipaddress import IPv4Network
from flask import Flask
from sipa.backends import Backends, DataSource, Dormitory, InitContextCallable
| [
11748,
302,
198,
6738,
2779,
2414,
1330,
2956,
7278,
8635,
62,
65,
2414,
268,
8189,
198,
6738,
28686,
1330,
2956,
3749,
198,
6738,
19720,
1330,
3350,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
555,
715,
395,
13,
76,
735,
... | 3.541176 | 85 |
#!/usr/bin/env python
"""
This script takes a JSON dictionary containing traditional chinese characters
as keys, and the simplified equivalents as values. It then outputs a header file
appropriate for inclusion. The header output file contains an array,
`Cn_T2S` which can be used as
```
simpChr = Cn_T2S[tradChr];... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
1212,
4226,
2753,
257,
19449,
22155,
7268,
4569,
442,
3762,
3435,
198,
292,
8251,
11,
290,
262,
27009,
40255,
355,
3815,
13,
632,
788,
23862,
257,
13639,
2393,
198,
13... | 2.348006 | 727 |
# -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
#
# 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.apac... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
34,
3185,
38162,
9947,
62,
27471,
198,
2,
198,
2,
15069,
685,
10333,
12,
4967,
60,
5136,
286,
19229,
23123,
40468,
11,
509,
17716,
322,
11,
12873,
198,
2,
1... | 3.284866 | 337 |
from rest_framework import status
from rest_framework.authentication import TokenAuthentication
from rest_framework.decorators import api_view, permission_classes, authentication_classes
from rest_framework.filters import SearchFilter, OrderingFilter
from rest_framework.generics import ListAPIView
from rest_framework.p... | [
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
1334,
62,
30604,
13,
41299,
3299,
1330,
29130,
47649,
3299,
198,
6738,
1334,
62,
30604,
13,
12501,
273,
2024,
1330,
40391,
62,
1177,
11,
7170,
62,
37724,
11,
18239,
62,
37724,
198,
6738,
1... | 3.390476 | 315 |
""" crypto.cipher.aes_cbc
AES_CBC Encryption Algorithm
Copyright (c) 2002 by Paul A. Lambert
Read LICENSE.txt for license information.
2002-06-14
"""
from crypto.cipher.aes import AES
from crypto.cipher.cbc import CBC
from crypto.cipher.base import BlockCipher, padWithPadLen, noPadding
class AES_... | [
37811,
21473,
13,
66,
10803,
13,
64,
274,
62,
66,
15630,
628,
220,
220,
220,
34329,
62,
29208,
14711,
13168,
978,
42289,
628,
220,
220,
220,
15069,
357,
66,
8,
6244,
416,
3362,
317,
13,
36978,
198,
220,
220,
220,
4149,
38559,
24290,... | 2.960938 | 128 |
import time
from threading import Thread
from typing import List
from fpakman.util.cache import Cache
| [
11748,
640,
198,
6738,
4704,
278,
1330,
14122,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
277,
41091,
805,
13,
22602,
13,
23870,
1330,
34088,
628,
198
] | 3.888889 | 27 |
#!/usr/bin/env python3
import sys
import json
from util.aoc import file_to_day
from util.input import load_data
if __name__ == "__main__":
test = len(sys.argv) > 1 and sys.argv[1] == "test"
main(test)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
25064,
198,
11748,
33918,
198,
198,
6738,
7736,
13,
64,
420,
1330,
2393,
62,
1462,
62,
820,
198,
6738,
7736,
13,
15414,
1330,
3440,
62,
7890,
628,
628,
628,
628,
198,... | 2.460674 | 89 |
import os
import fsspec
import numpy as np
from PIL import Image
from PIL import ImageDraw
| [
11748,
28686,
198,
11748,
277,
824,
43106,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
350,
4146,
1330,
7412,
25302,
628,
628,
628
] | 3.233333 | 30 |
from django.urls import re_path
from . import views
urlpatterns = [
re_path(r'^action/', views.action_view),
re_path(r'^append-block/', views.append_block_view),
re_path(r'^edit-block/', views.edit_block_view),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
302,
62,
6978,
198,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
302,
62,
6978,
7,
81,
6,
61,
2673,
14,
3256,
5009,
13,
2673,
62,
1177,
828,
198,
22... | 2.414894 | 94 |
from __future__ import annotations
import json
from base64 import b64decode, b64encode
from copy import deepcopy as dp
from io import BytesIO
from random import randrange
from string import digits as strdigits
from typing import Generator, IO
from . import utils
from .common import Cipher, Crypter
from .exceptions im... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
33918,
198,
6738,
2779,
2414,
1330,
275,
2414,
12501,
1098,
11,
275,
2414,
268,
8189,
198,
6738,
4866,
1330,
2769,
30073,
355,
288,
79,
198,
6738,
33245,
1330,
2750,
4879,
9399,
198... | 1.663578 | 4,533 |
from . import base
from . import data
from . import envs
from . import nets
from . import prob
from . import sche
from . import patch
from . import utils | [
6738,
764,
1330,
2779,
198,
6738,
764,
1330,
1366,
198,
6738,
764,
1330,
551,
14259,
198,
6738,
764,
1330,
31720,
198,
6738,
764,
1330,
1861,
198,
6738,
764,
1330,
3897,
198,
6738,
764,
1330,
8529,
198,
6738,
764,
1330,
3384,
4487
] | 3.731707 | 41 |
from datetime import timedelta
SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:root@127.0.0.1:3306/mine_blog"
SQLALCHEMY_TRACK_MODIFICATIONS = True
JWT_SECRET_KEY = 'jwt_secret'
JWT_AUTH_URL_RULE = '/api/v1/auth'
JWT_EXPIRATION_DELTA = timedelta(seconds=12000)
SYS_UPLOAD_PATH = '/home/laowang/gitwarehouse/mine_blog/ap... | [
6738,
4818,
8079,
1330,
28805,
12514,
198,
198,
17861,
1847,
3398,
3620,
56,
62,
35,
1404,
6242,
11159,
62,
47269,
796,
366,
28744,
13976,
10,
79,
4948,
893,
13976,
1378,
15763,
25,
15763,
31,
16799,
13,
15,
13,
15,
13,
16,
25,
18,
... | 2.132022 | 356 |
# Generated by Django 3.1.4 on 2020-12-17 12:05
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
19,
319,
12131,
12,
1065,
12,
1558,
1105,
25,
2713,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# To run this, download the BeautifulSoup zip file
# http://www.py4e.com/code3/bs4.zip
# and unzip it in the same directory as this file
from urllib.request import urlopen
from bs4 import BeautifulSoup
import ssl
# Ignore SSL certificate errors
ctx = ssl.create_default_context()
ctx.check_hostname = False
... | [
2,
1675,
1057,
428,
11,
4321,
262,
23762,
50,
10486,
19974,
2393,
201,
198,
2,
2638,
1378,
2503,
13,
9078,
19,
68,
13,
785,
14,
8189,
18,
14,
1443,
19,
13,
13344,
201,
198,
2,
290,
555,
13344,
340,
287,
262,
976,
8619,
355,
428,... | 2.656716 | 268 |
"""
Donate to Createor : { just follow me on github
and star to this project }
"""
# complement this fields
| [
37811,
198,
3987,
378,
284,
13610,
273,
1058,
1391,
655,
1061,
502,
319,
33084,
220,
198,
197,
197,
220,
220,
220,
220,
290,
3491,
284,
428,
1628,
1782,
628,
198,
37811,
628,
198,
2,
16829,
428,
7032,
198,
197,
198,
197,
198,
197
] | 2.906977 | 43 |
import discord
from discord.ext import commands
import asyncpg
import datetime
from dotenv import load_dotenv
import os
load_dotenv('.env')
INITIAL_EXTENSIONS = [
'cogs.dev',
'cogs.events',
'cogs.fun',
'cogs.games',
'cogs.help',
'cogs.image',
'cogs.mod',
'cogs.utility'... | [
11748,
36446,
201,
198,
6738,
36446,
13,
2302,
1330,
9729,
201,
198,
11748,
30351,
6024,
201,
198,
11748,
4818,
8079,
201,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
201,
198,
11748,
28686,
201,
198,
201,
198,
2220,
62,
2651... | 2.120219 | 183 |
"""The WaveBlocks Project
The basic common algorithms for evaluation Hagedorn basis functions
of the old kind.
@author: R. Bourquin
@copyright: Copyright (C) 2016 R. Bourquin
@license: Modified BSD License
"""
from numpy import complexfloating, dot, vstack, zeros, conjugate
from scipy import sqrt
from scipy.linalg i... | [
37811,
464,
17084,
45356,
4935,
198,
198,
464,
4096,
2219,
16113,
329,
12660,
367,
1886,
1211,
4308,
5499,
198,
1659,
262,
1468,
1611,
13,
198,
198,
31,
9800,
25,
371,
13,
20576,
21915,
198,
31,
22163,
4766,
25,
15069,
357,
34,
8,
1... | 2.014191 | 3,312 |
from datetime import datetime
from django.db import models
from django.conf import settings
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db.models.signals import post_save
from django.dispatch import receiver
from serverConfig.models.gestionParams import GestionParam
... | [
6738,
4818,
8079,
1330,
4818,
8079,
201,
198,
201,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
201,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
201,
198,
6738,
42625,
14208,
13,
7295,
13,
12102,
2024,
1330,
5436,
11395,
47139,
13... | 3.516393 | 122 |
# Simple PyPong in Python 3
import turtle
window = turtle.Screen()
window.title("PyPong by Grantlee11")
window.bgcolor("black")
window.setup(width = 800, height = 600)
window.tracer(0)
# Score
scoreA = 0
scoreB = 0
# Paddle A
paddleA = turtle.Turtle()
paddleA.speed(0)
paddleA.shape("square")
paddleA.color("white"... | [
2,
17427,
9485,
47,
506,
287,
11361,
513,
198,
198,
11748,
28699,
198,
198,
17497,
796,
28699,
13,
23901,
3419,
198,
17497,
13,
7839,
7203,
20519,
47,
506,
416,
12181,
7197,
1157,
4943,
198,
17497,
13,
35904,
8043,
7203,
13424,
4943,
... | 2.262295 | 1,098 |
import unittest
from wasmtime import *
| [
11748,
555,
715,
395,
198,
198,
6738,
373,
76,
2435,
1330,
1635,
628
] | 3.153846 | 13 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright (c) 2015, dNeural.com
#
# 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 rig... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
66,
8,
1853,
11,
288,
8199,
1523,
13,
785,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
1... | 3.288431 | 631 |
import FWCore.ParameterSet.Config as cms
from DQMOffline.Trigger.RazorMonitor_cff import *
from DQMOffline.Trigger.VBFSUSYMonitor_cff import *
from DQMOffline.Trigger.LepHTMonitor_cff import *
from DQMOffline.Trigger.susyHLTEleCaloJets_cff import *
from DQMOffline.Trigger.SoftMuHardJetMETSUSYMonitor_cff import *
from ... | [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
6738,
360,
48,
44,
28657,
13,
48344,
13,
49,
17725,
35479,
62,
66,
487,
1330,
1635,
198,
6738,
360,
48,
44,
28657,
13,
48344,
13,
44526,
10652,
2937,
56,
3547... | 2.073204 | 7,363 |
from flask import Flask, redirect, url_for, request, render_template, make_response, session, send_from_directory, send_file
import uuid
import datetime
import io
import grpc
import prototype_pb2_grpc
import prototype_pb2
import base64
import json
from prometheus_client import Counter, start_http_server
import os
app ... | [
6738,
42903,
1330,
46947,
11,
18941,
11,
19016,
62,
1640,
11,
2581,
11,
8543,
62,
28243,
11,
787,
62,
26209,
11,
6246,
11,
3758,
62,
6738,
62,
34945,
11,
3758,
62,
7753,
198,
11748,
334,
27112,
198,
11748,
4818,
8079,
198,
11748,
33... | 2.597959 | 490 |
import asyncio
import json
import os
from threading import Timer
name = "Help"
description = """
Module for displaying help
modules: prints all modules
help *module*: prints help for a Module
"""
metadata = {}
functions = {
"modules": Modules,
"help": Help
}
| [
11748,
30351,
952,
198,
11748,
33918,
198,
11748,
28686,
198,
6738,
4704,
278,
1330,
5045,
263,
198,
198,
3672,
796,
366,
22087,
1,
198,
11213,
796,
37227,
198,
26796,
329,
19407,
1037,
198,
198,
18170,
25,
20842,
477,
13103,
198,
16794... | 3.235294 | 85 |
#!/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,
628
] | 2.15 | 20 |
from absgridworld import AbsGridworld
class WindyGridworld(AbsGridworld):
"""Class representing a windy girdworld"""
def __init__(self, schema: list, actions: list, stepPenalty: float, columnToWindMap: dict) -> None:
"""
Description
----------
Constructor used for processing t... | [
6738,
2352,
25928,
6894,
1330,
13051,
41339,
6894,
628,
198,
4871,
3086,
88,
41339,
6894,
7,
24849,
41339,
6894,
2599,
198,
220,
220,
220,
37227,
9487,
10200,
257,
2344,
88,
308,
1447,
6894,
37811,
628,
220,
220,
220,
825,
11593,
15003,... | 2.661064 | 357 |
from django.db import models
# Create your models here. | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13
] | 3.733333 | 15 |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
24893,
1087,
318,
10607,
284,
1104,
262,
1280,
2723,
2055,
416,
1642,
347,
42,
12,
33,
11159,
5525,
241,
251,
165,
110,
116,
161,
253,
118,
163,
94,
222,
... | 3.337864 | 515 |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 11 17:47:46 2021
@author: vlad-eusebiu.baciu@vub.be
"""
import pyqtgraph as pg
import sys
import logo_qrc
import ctypes
from PyQt5 import QtWidgets, uic
from pyqtgraph import PlotWidget
from application1 import App1_Gui
from application2 import App2_Gui
if __name__ ==... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
5267,
1367,
1596,
25,
2857,
25,
3510,
33448,
198,
198,
31,
9800,
25,
410,
9435,
12,
68,
1904,
8482,
84,
13,
65,
330,
16115,
31,
85,
54... | 2.559701 | 134 |
from random import randint,uniform
from math import ceil
from my_or_tools import newSolver, ObjVal, SolVal
| [
198,
6738,
4738,
1330,
43720,
600,
11,
403,
6933,
198,
6738,
10688,
1330,
2906,
346,
198,
198,
6738,
616,
62,
273,
62,
31391,
1330,
649,
50,
14375,
11,
38764,
7762,
11,
4294,
7762,
198
] | 3.205882 | 34 |
# coding: utf8
# Author: Wing Yung Chan (~wy)
# Date: 2017
#non-abundant sums
# N is non-abundant if the sum of its proper divisors is <= N
# prop(N) = Set{1 <= i < N | N % i == 0}
print(problem23())
| [
2,
19617,
25,
3384,
69,
23,
198,
2,
6434,
25,
13405,
575,
2150,
18704,
31034,
21768,
8,
198,
2,
7536,
25,
2177,
198,
198,
2,
13159,
12,
397,
917,
415,
21784,
198,
198,
2,
399,
318,
1729,
12,
397,
917,
415,
611,
262,
2160,
286,
... | 2.481928 | 83 |
# start_scheduler_marker_0
import csv
from datetime import datetime
import requests
from dagster import get_dagster_logger, job, op, repository, schedule
@op
@job
# end_scheduler_marker_0
# start_scheduler_marker_1
@schedule(
cron_schedule="45 6 * * *",
job=hello_cereal_job,
execution_timezone="US/C... | [
2,
923,
62,
1416,
704,
18173,
62,
4102,
263,
62,
15,
198,
11748,
269,
21370,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11748,
7007,
198,
6738,
48924,
1706,
1330,
651,
62,
67,
363,
1706,
62,
6404,
1362,
11,
1693,
11,
1034,
... | 2.346021 | 289 |
import pickle
import re
import copy
import numpy as np
import pandas as pd
from torch import nn
import torch
from counterfit.core.targets import Target
class MovieReviewsSentimentLSTM(nn.Module):
"""pre-trained LSTM model on 25 epochs for building sentiment analysis model on IMDB movies review dataset.
"""... | [
11748,
2298,
293,
198,
11748,
302,
198,
11748,
4866,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
28034,
1330,
299,
77,
198,
11748,
28034,
198,
198,
6738,
3753,
11147,
13,
7295,
13,
83,
853... | 2.196328 | 2,124 |