content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
33448,
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,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
733... | 2.9757 | 1,358 |
# -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
24893,
1087,
14573,
15708,
318,
10607,
284,
1104,
262,
1280,
2723,
2055,
416,
1642,
5525,
241,
251,
165,
110,
116,
162,
247,
118,
12859,
239,
12,
164,
232,
... | 1.882035 | 3,518 |
#!/usr/bin/env python
#
# Copyright 2017
# Johannes K. Fichte, TU Wien, Austria
#
# runsolver_wrapper.py 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) a... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
2177,
198,
2,
38579,
509,
13,
376,
488,
660,
11,
309,
52,
370,
2013,
11,
17322,
198,
2,
198,
2,
4539,
14375,
62,
48553,
13,
9078,
318,
1479,
3788,
25,
345,
460,... | 2.722513 | 955 |
import sys
# input
N, K = map(int, sys.stdin.readline().split())
names = list(map(int, sys.stdin.readline().split()))
# output
plugs = []
# set plugs
for i in range(K):
if len(plugs) == N: break
if names[i] not in plugs:
plugs.append(names[i])
answer = 0
# search all names
for i in range(N, K):
# ... | [
11748,
25064,
198,
198,
2,
5128,
198,
45,
11,
509,
796,
3975,
7,
600,
11,
25064,
13,
19282,
259,
13,
961,
1370,
22446,
35312,
28955,
198,
14933,
796,
1351,
7,
8899,
7,
600,
11,
25064,
13,
19282,
259,
13,
961,
1370,
22446,
35312,
3... | 2.334158 | 404 |
# Copyright (c) 2020 SBA- MIT License
"""WSGI application aimed at providing a remote access.
It can only be used in a single process WSGI server
"""
import logging.config
import os.path
import shlex
import subprocess
import sys
from cryptography import fernet
from remo_tools.http_tools import build_status
from .... | [
2,
220,
15069,
357,
66,
8,
12131,
311,
4339,
12,
17168,
13789,
198,
198,
37811,
19416,
18878,
3586,
8998,
379,
4955,
257,
6569,
1895,
13,
198,
198,
1026,
460,
691,
307,
973,
287,
257,
2060,
1429,
25290,
18878,
4382,
198,
37811,
198,
... | 2.076496 | 4,144 |
#!/usr/bin/env python
from pathlib import Path
from django.core.management import execute_from_command_line
from coltrane import initialize
# Pass in this file's parent as the BASE_DIR because app.py lives in a sub-folder
wsgi = initialize(BASE_DIR=Path(__file__).resolve().parent)
if __name__ == "__main__":
e... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
1330,
12260,
62,
6738,
62,
21812,
62,
1370,
198,
198,
6738,
951,
2213,
1531,
1330,
41216,
628,
19... | 3.126126 | 111 |
from django.conf import settings
from django.utils.translation import get_language_from_request
from hippocampus import HIPPOCAMPUS_COOKIE_NAME
from hippocampus.models import *
try:
import GeoIP
except ImportError:
GeoIP = None
| [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
62,
16129,
62,
6738,
62,
25927,
198,
198,
6738,
38587,
1330,
367,
31444,
4503,
23518,
2937,
62,
34,
15308,
10008,
62,
20608,
198,
6738,... | 3.352113 | 71 |
"""Parser for virtual-machine sub-command."""
import argparse
from emulation_system.parser_utils import get_formatter
from emulation_system.commands.virtual_machine_command_creator import (
VirtualMachineCommandCreator,
VirtualMachineSubCommandOptions,
VirtualMachineSubCommands,
)
from emulation_system.pars... | [
37811,
46677,
329,
7166,
12,
30243,
850,
12,
21812,
526,
15931,
198,
11748,
1822,
29572,
198,
6738,
47065,
62,
10057,
13,
48610,
62,
26791,
1330,
651,
62,
687,
1436,
198,
6738,
47065,
62,
10057,
13,
9503,
1746,
13,
32844,
62,
30243,
6... | 2.493166 | 878 |
import hello
#def test_says_world():
#assert hello.say_what() == 'world'
| [
11748,
23748,
628,
198,
2,
4299,
1332,
62,
82,
592,
62,
6894,
33529,
198,
2,
30493,
23748,
13,
16706,
62,
10919,
3419,
6624,
705,
6894,
6,
198
] | 2.777778 | 27 |
from machinetranslation import translator
from flask import Flask, render_template, request
import json
app = Flask("Web Translator",template_folder='templates')
@app.route("/englishToSpanish")
@app.route("/spanishToEnglish")
@app.route("/")
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8080)
| [
6738,
3235,
259,
21879,
504,
7592,
1330,
33417,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
198,
11748,
33918,
198,
1324,
796,
46947,
7203,
13908,
3602,
41880,
1600,
28243,
62,
43551,
11639,
11498,
17041,
11537,
198,
198... | 2.898148 | 108 |
"""
This module contains functions to open and parse the files found in
:module:`.constants`. This is so other parts of the program do not become
coupled to the data parsing processes.
"""
__all__ = [
"generic_io",
"uniprot_sprot",
"uniprot_trembl",
"hprd_ptms",
"hprd_id_map",
"bioplex_v4",
... | [
37811,
198,
1212,
8265,
4909,
5499,
284,
1280,
290,
21136,
262,
3696,
1043,
287,
220,
198,
25,
21412,
25,
44646,
9979,
1187,
44646,
770,
318,
523,
584,
3354,
286,
262,
1430,
466,
407,
1716,
220,
198,
66,
280,
10137,
284,
262,
1366,
... | 2.408463 | 2,316 |
# Speed
VELOCITY = 0.25 # 0.305 # m/s
TURN_RATE = 1.2 # 2.1 #4.19 #80.0 # deg/s or 4.19 rad/s
# Time To Travel
TTT_1M = 1 / VELOCITY # 1 meters
TTT_90DEG = 90 / TURN_RATE # 90 degree turn
| [
2,
8729,
198,
18697,
4503,
9050,
796,
657,
13,
1495,
220,
1303,
657,
13,
22515,
1303,
285,
14,
82,
198,
51,
27064,
62,
49,
6158,
796,
352,
13,
17,
220,
1303,
362,
13,
16,
1303,
19,
13,
1129,
1303,
1795,
13,
15,
1303,
3396,
14,
... | 1.989691 | 97 |
from . import PUBLISHED_TODAY, STRINGIFY, YESTERDAY
from bs4 import BeautifulSoup
from datetime import datetime
import feedparser
import re
import requests
| [
6738,
764,
1330,
24676,
9148,
18422,
1961,
62,
51,
3727,
4792,
11,
19269,
2751,
5064,
56,
11,
21560,
5781,
26442,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
3745,
48610,
198,
1... | 3.215686 | 51 |
import datetime
import re
from urllib.parse import urlparse
from .source import Source
from ... import BadResponseException
from ...models import Chapter, Novel
| [
11748,
4818,
8079,
198,
11748,
302,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
198,
198,
6738,
764,
10459,
1330,
8090,
198,
6738,
2644,
1330,
7772,
31077,
16922,
198,
6738,
2644,
27530,
1330,
7006,
11,
24467,
628
] | 4.179487 | 39 |
"""
Module for Layers that can be used as body in the _Module objects.
(c) 2020 d373c7
"""
import torch
import torch.nn as nn
from .common import Layer
from .base import PositionalEncoding, PositionalEmbedding, ConvolutionalBodyBase1d
from collections import OrderedDict
from typing import List, Tuple
# TODO Remove an... | [
37811,
198,
26796,
329,
406,
6962,
326,
460,
307,
973,
355,
1767,
287,
262,
4808,
26796,
5563,
13,
198,
7,
66,
8,
12131,
288,
34770,
66,
22,
198,
37811,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
764,
... | 3.476584 | 363 |
# Generated by Django 2.2.1 on 2019-05-16 03:09
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
16,
319,
13130,
12,
2713,
12,
1433,
7643,
25,
2931,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 1 19:50:54 2016
@author: max
"""
import tensorflow as tf
import numpy as np
import matplotlib.pylab as m
x_data = np.linspace(0.0,1.0,num = 500,dtype='float32')
x_data = np.reshape(x_data,(500,))
y_data = np.linspace(0.0,1.0,num = 500,dtype='float32')
y_data = y_data ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
2892,
2447,
220,
352,
678,
25,
1120,
25,
4051,
1584,
198,
198,
31,
9800,
25,
3509,
198,
37811,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
... | 2.064982 | 554 |
#!/usr/bin/env python
import os
import numpy as np
import cv2
import select
import threading
from time import time
from detector import Detector
from video_reader import VideoReader
if __name__ == '__main__':
detector = VideoDetector()
detector.start()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
2922,
198,
11748,
4704,
278,
198,
6738,
640,
1330,
640,
198,
6738,
31029,
1330,
4614,
9250,
... | 3.3 | 80 |
#!/usr/bin/env python3
import pet
if __name__ == "__main__":
p = pet.Pet("Michael")
print(p)
if p.getName() != "Michael":
print("Oops")
else:
print("Welcome, {}".format(p.getName()))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
4273,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
279,
796,
4273,
13,
25803,
7203,
13256,
4943,
198,
220,
220,
220,
3601,
7,
79,... | 2.16 | 100 |
import os
import numpy as np
ann_dir_path = "/home/maaz/PycharmProjects/VOC_EVAL/dets_from_diff_methods/mdetr_dets_tq"
text_queries = ['all_small_objects', 'all_medium_objects', 'all_large_objects']
output_dir = "/home/maaz/PycharmProjects/VOC_EVAL/dets_from_diff_methods/mdetr_dets_tq/combine_11"
if not os.path.exists... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
198,
1236,
62,
15908,
62,
6978,
796,
12813,
11195,
14,
2611,
1031,
14,
20519,
354,
1670,
16775,
82,
14,
53,
4503,
62,
20114,
1847,
14,
67,
1039,
62,
6738,
62,
26069,
62,
24396,
... | 1.989766 | 684 |
# Copyright 2020 Alvin Chen sonoma001@gmail.com
# SPDX-License-Identifier: GPL-2.0+
import logging
from .exceptions import AuthorizationError, DependencyTrackApiError
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
class Licenses:
"""Class dedicated to all "licenses" related endpoints"""
... | [
2,
15069,
12131,
49939,
12555,
3367,
6086,
8298,
31,
14816,
13,
785,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
38644,
12,
17,
13,
15,
10,
198,
198,
11748,
18931,
198,
198,
6738,
764,
1069,
11755,
1330,
35263,
12331,
11,
379... | 2.451357 | 884 |
""" Test simulation of a coupled dot system."""
# %% Load packages
import numpy as np
import unittest
from qtt.simulation.dotsystem import OneDot, DoubleDot, TripleDot, FourDot, TwoXTwo
| [
37811,
6208,
18640,
286,
257,
18064,
16605,
1080,
526,
15931,
198,
198,
2,
43313,
8778,
10392,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
555,
715,
395,
198,
6738,
10662,
926,
13,
14323,
1741,
13,
67,
1747,
6781,
1330,
1881,
... | 3.114754 | 61 |
""" Converts any image to EPS, using ImageMagick as a backend.
"""
from waflib import Logs
from waflib import TaskGen,Task
from waflib import Utils
from waflib.Configure import conf
@conf
| [
37811,
1482,
24040,
597,
2939,
284,
47013,
11,
1262,
7412,
13436,
624,
355,
257,
30203,
13,
198,
37811,
198,
6738,
266,
1878,
8019,
1330,
5972,
82,
198,
6738,
266,
1878,
8019,
1330,
15941,
13746,
11,
25714,
198,
6738,
266,
1878,
8019,
... | 3.20339 | 59 |
"""
Date: 02/01/2020
Made by: Clara Martens Avila
Description: Classes, some of which are not yet used, to run a game in Jaqcards.
"""
## CHARACTER CLASSES ##
## WORLD CLASSES ##
## GAMEPLAY CLASSES ##
## PROCESSES ##
| [
37811,
198,
10430,
25,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7816,
14,
486,
14,
42334,
198,
24616,
416,
25,
220,
220,
220,
220,
220,
220,
220,
27443,
3981,
641,
317,
2991,
64,
198,
11828,
25,
220,
220,
220,
38884,
11,
... | 2.53 | 100 |
#!/usr/bin/python
#-*- coding: utf-8 -*-
import socket
print 'creating socket ...'
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
print 'socket created'
print "connection with remote host"
s.connect(('www.google.com',80))
print 'connection ok'
s.send( 'GET /index.html HTML/1.1\r\n\r\n')
while 1:
data=s.recv(128)... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
12,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
17802,
198,
198,
4798,
705,
20123,
278,
17802,
2644,
6,
198,
82,
28,
44971,
13,
44971,
7,
44971,
13,
8579,
62,
... | 2.471698 | 159 |
# coding=utf-8
"""
Package an ls5 Ortho dataset.
"""
from __future__ import absolute_import
import datetime
from pathlib import Path
import yaml
from tests import temp_dir, assert_file_structure, assert_same, integration_test, run_packaging_cli, as_file_list
from tests.integration import load_checksum_filenames, har... | [
2,
19617,
28,
40477,
12,
23,
198,
37811,
198,
27813,
281,
43979,
20,
47664,
78,
27039,
13,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
4818,
8079,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
117... | 1.701124 | 4,537 |
import unittest
import os
from programy.utils.files.filewriter import TextFile
from programytest.utils.files.utils import get_os_specific_path
| [
11748,
555,
715,
395,
198,
11748,
28686,
198,
6738,
1430,
88,
13,
26791,
13,
16624,
13,
7753,
16002,
1330,
8255,
8979,
198,
6738,
1430,
88,
9288,
13,
26791,
13,
16624,
13,
26791,
1330,
651,
62,
418,
62,
11423,
62,
6978,
628,
628,
62... | 3.44186 | 43 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Content:主对角线之和
# 地址:http: //www.runoob.com/python/python-exercise-example38.html
# 知识点:二维数组
# 地址:
# Notes:
if __name__ == "__main__":
a = []
# for i in range(3):
# a.append([])
# for j in range(3):
# a[i].append(float(input("input nu... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
2,
14041,
171,
120,
248,
10310,
119,
43380,
117,
164,
100,
240,
163,
118,
123,
45298,
161,
240,
234,
198,
2,
10263,... | 1.518349 | 436 |
"""
File: find Willy.py
Name: An Lee
----------------------------------
Combine the figure and background, then make whole new image left only two color: black and white.
Then make a maze with original background to hide the figure.
Let's play "find Willy" !
"""
from simpleimage import SimpleImage
def combine(backg... | [
37811,
198,
8979,
25,
1064,
2561,
88,
13,
9078,
198,
5376,
25,
1052,
5741,
198,
3880,
438,
198,
20575,
500,
262,
3785,
290,
4469,
11,
788,
787,
2187,
649,
2939,
1364,
691,
734,
3124,
25,
2042,
290,
2330,
13,
198,
6423,
787,
257,
3... | 2.394794 | 922 |
from mlpug.trainers.callbacks.metrics_logger import *
from mlpug.trainers.callbacks.metrics_logger import \
TrainingMetricsLogger as TrainingMetricsLoggerBase, \
TestMetricsLogger as TestMetricsLoggerBase
from mlpug.pytorch.multi_processing import MultiProcessingMixin
from mlpug.pytorch.utils import SlidingW... | [
6738,
25962,
79,
1018,
13,
27432,
364,
13,
13345,
10146,
13,
4164,
10466,
62,
6404,
1362,
1330,
1635,
198,
198,
6738,
25962,
79,
1018,
13,
27432,
364,
13,
13345,
10146,
13,
4164,
10466,
62,
6404,
1362,
1330,
3467,
198,
220,
220,
220,
... | 2.981818 | 110 |
# -*- coding: utf-8 -*-
# author by LYS 2017/5/24
# for Deep Learning course
'''
python随机选取10000张图片并复制到另一个文件夹中
1. read the whole files under a certain folder
2. chose 10000 files randomly
3. copy them to another folder and save
'''
import os, random, shutil
if __name__ == '__main__':
fileDir = "/home/ambavm/BDD/trai... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
1772,
416,
406,
16309,
2177,
14,
20,
14,
1731,
198,
2,
329,
10766,
18252,
1781,
198,
7061,
6,
198,
29412,
49694,
237,
17312,
118,
34460,
231,
20998,
244,
49388... | 2.25 | 188 |
from tkinter import *
root = Tk()
# Width x Height
root.geometry("644x434")
# width, height
root.minsize(300,100)
# width, height
root.maxsize(1200, 988)
sx = Label(text="This is the GUI")
sx.pack()
root.mainloop()
| [
6738,
256,
74,
3849,
1330,
1635,
198,
198,
15763,
796,
309,
74,
3419,
198,
198,
2,
38807,
2124,
27280,
198,
15763,
13,
469,
15748,
7203,
29173,
87,
47101,
4943,
198,
198,
2,
9647,
11,
6001,
198,
15763,
13,
42951,
1096,
7,
6200,
11,
... | 2.466667 | 90 |
import warnings
warnings.filterwarnings('ignore')
import torch
from torchvision.utils import save_image
import os
from tqdm import tqdm
from torch import Tensor
import torch.nn.functional as F
import numpy as np
from dataset import VAD, TRIAL_FILE, FEATURE_LEN
from dataset import SpeakerTrainDataset, SpeakerT... | [
11748,
14601,
201,
198,
40539,
654,
13,
24455,
40539,
654,
10786,
46430,
11537,
201,
198,
11748,
28034,
201,
198,
6738,
28034,
10178,
13,
26791,
1330,
3613,
62,
9060,
201,
198,
11748,
28686,
201,
198,
6738,
256,
80,
36020,
1330,
256,
80... | 2.800613 | 652 |
# keys defined in json file configuration or parameters
SCLI_JSON_FW = "firewall_mgmt"
SCLI_JSON_USER = "admin_account"
SCLI_JSON_PWD = "admin_password"
SCLI_JSON_TARGET = "target"
SCLI_JSON_PROTOCOL = "protocol"
SCLI_JSON_PORT = "port"
SCLI_JSON_PORTEND = "port_end"
SCLI_ACL_COMMENT = "Security Automation fr... | [
2,
8251,
5447,
287,
33918,
2393,
8398,
393,
10007,
201,
198,
50,
5097,
40,
62,
40386,
62,
24160,
796,
366,
6495,
11930,
62,
11296,
16762,
1,
201,
198,
50,
5097,
40,
62,
40386,
62,
29904,
796,
366,
28482,
62,
23317,
1,
201,
198,
50... | 2.345455 | 275 |
from typing import Optional, Dict
import pika
from pika import exceptions
import shared.infrastructure.environment.globalvars as glob
from shared.domain.service.logging.logger import Logger
| [
6738,
19720,
1330,
32233,
11,
360,
713,
198,
11748,
279,
9232,
198,
6738,
279,
9232,
1330,
13269,
198,
11748,
4888,
13,
10745,
6410,
13,
38986,
13,
20541,
85,
945,
355,
15095,
198,
6738,
4888,
13,
27830,
13,
15271,
13,
6404,
2667,
13,... | 3.979167 | 48 |
from .instance import Instance
from .solution import Solution
from .experiment import Experiment
from .batch import Batch, ZipBatch
| [
6738,
764,
39098,
1330,
2262,
590,
198,
6738,
764,
82,
2122,
1330,
28186,
198,
6738,
764,
23100,
3681,
1330,
29544,
198,
6738,
764,
43501,
1330,
347,
963,
11,
38636,
33,
963,
198
] | 4.125 | 32 |
import factory
from sqlalchemy import or_
from backend.extensions import db
from backend.models import Hacknight, Participant, User
| [
11748,
8860,
198,
6738,
44161,
282,
26599,
1330,
393,
62,
198,
198,
6738,
30203,
13,
2302,
5736,
1330,
20613,
198,
6738,
30203,
13,
27530,
1330,
18281,
3847,
11,
29880,
11,
11787,
628,
628,
198
] | 4.029412 | 34 |
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.functional as F
from scipy.stats import logistic
import argparse
DEF_ARGS = argparse.Namespace(data_path='ex_seqs.fa', output_path='ex_seqs_out', cuda=False)
SEQ_DICT = {'A': [0], 'T': [1], 'C': [2], 'G': [3], 'R': [0,3],
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
629,
541,
88,
13,
34242,
1330,
2604,
256... | 2.043609 | 1,330 |
from datetime import datetime, timedelta
from Hinkskalle.models.Entity import Entity, EntitySchema
from Hinkskalle.models.Collection import Collection
from Hinkskalle import db
from ..model_base import ModelBase
from .._util import _create_user, _create_image
| [
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
198,
6738,
367,
2973,
74,
6765,
13,
27530,
13,
32398,
1330,
20885,
11,
20885,
27054,
2611,
198,
6738,
367,
2973,
74,
6765,
13,
27530,
13,
36307,
1330,
12251,
198,
6738,
367,
2... | 3.652778 | 72 |
import argparse
from .settings import SimfectionSettings
settings = SimfectionSettings()
simfection_args = {
('-nd', '--num-days'): {
'help': (
'number of days to simulate \n(default: {})'
.format(settings.get_setting('num_days'))
),
'type': int,
'required... | [
11748,
1822,
29572,
198,
6738,
764,
33692,
1330,
3184,
2309,
295,
26232,
198,
198,
33692,
796,
3184,
2309,
295,
26232,
3419,
628,
198,
198,
14323,
2309,
295,
62,
22046,
796,
1391,
198,
220,
220,
220,
19203,
12,
358,
3256,
705,
438,
22... | 1.919953 | 1,699 |
from output.models.ms_data.schema.sch_f2_a_xsd.sch_f2_a import (
CtA as CtA,
E1 as E1,
Root,
)
from output.models.ms_data.schema.sch_f2_a_xsd.sch_f2_b import (
CtA as BCtA,
E1 as BE1,
)
__all__ = [
"CtA",
"E1",
"Root",
"BCtA",
"BE1",
]
| [
6738,
5072,
13,
27530,
13,
907,
62,
7890,
13,
15952,
2611,
13,
20601,
62,
69,
17,
62,
64,
62,
87,
21282,
13,
20601,
62,
69,
17,
62,
64,
1330,
357,
198,
220,
220,
220,
43166,
32,
355,
43166,
32,
11,
198,
220,
220,
220,
412,
16,... | 1.709877 | 162 |
from setuptools import setup, find_packages
setup(
name='frasco-assets',
version='0.2.2',
url='http://github.com/frascoweb/frasco-assets',
license='MIT',
author='Maxime Bouroumeau-Fuseau',
author_email='maxime.bouroumeau@gmail.com',
description="Assets management using easywebassets for Fr... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
628,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
8310,
292,
1073,
12,
19668,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
17,
13,
17,
3256,
198,
220,
220,
220,
19016,
... | 2.233333 | 270 |
from flask import Flask, render_template
from urllib.request import urlopen, Request
import bs4
app = Flask(__name__)
@app.route('/')
if __name__ == '__main__':
# app.run(host='0.0.0.0', debug=True)
app.run(debug=True)
| [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
9654,
11,
19390,
198,
11748,
275,
82,
19,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
198,
31,
1324,
13,
38629,
10786,
14,
... | 2.5 | 92 |
from database import create_table, add_entry, get_entries
menu = """Please select one of the following options:
1) Add new entry for today.
2) View entries.
3) Exit.
Your selection: """
welcome = "Welcome to the programming diary!"
print(welcome)
create_table()
# ':=' is the walrus operator.
# python >= 3.8 is req... | [
6738,
6831,
1330,
2251,
62,
11487,
11,
751,
62,
13000,
11,
651,
62,
298,
1678,
628,
198,
26272,
796,
37227,
5492,
2922,
530,
286,
262,
1708,
3689,
25,
198,
16,
8,
3060,
649,
5726,
329,
1909,
13,
198,
17,
8,
3582,
12784,
13,
198,
... | 2.795 | 200 |
import numpy as np
import math
import particles
import pickle
if __name__ == "__main__":
# Create object of classes Simulator and Particles
simulator = Simulator()
particles = particles.Particles(simulator)
# Load file with the saved simulation results
sa... | [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
10688,
201,
198,
11748,
13166,
201,
198,
11748,
2298,
293,
201,
198,
201,
198,
220,
220,
220,
220,
201,
198,
201,
198,
220,
220,
220,
220,
201,
198,
220,
220,
220,
220,
220,
220,
220,
... | 2.485973 | 1,105 |
"""Test cases for the fnmatch module."""
import unittest
import os
import string
import warnings
from fnmatch import fnmatch, fnmatchcase, translate, filter
if __name__ == "__main__":
unittest.main()
| [
37811,
14402,
2663,
329,
262,
24714,
15699,
8265,
526,
15931,
198,
198,
11748,
555,
715,
395,
198,
11748,
28686,
198,
11748,
4731,
198,
11748,
14601,
198,
198,
6738,
24714,
15699,
1330,
24714,
15699,
11,
24714,
15699,
7442,
11,
15772,
11,... | 3.215385 | 65 |
"""Make paths importable app-wide"""
import os
import imp_flask as app_root
APP_ROOT_FOLDER = os.path.abspath(os.path.dirname(app_root.__file__))
TEMPLATE_FOLDER = os.path.join(APP_ROOT_FOLDER, 'templates')
TEXTEMPLATE_FOLDER = os.path.join(APP_ROOT_FOLDER, 'textemplates')
TEXSTATIC_FOLDER = os.path.join(AP... | [
37811,
12050,
13532,
1330,
540,
598,
12,
4421,
37811,
201,
198,
201,
198,
11748,
28686,
201,
198,
201,
198,
11748,
848,
62,
2704,
2093,
355,
598,
62,
15763,
201,
198,
201,
198,
24805,
62,
13252,
2394,
62,
37,
3535,
14418,
796,
28686,
... | 2.206522 | 184 |
#You can import any required modules here
#This can be anything you want
moduleName = "templateModule"
#All of the words must be heard in order for this module to be executed
commandWords = ["xyz"]
| [
2,
1639,
460,
1330,
597,
2672,
13103,
994,
198,
198,
2,
1212,
460,
307,
1997,
345,
765,
198,
21412,
5376,
796,
366,
28243,
26796,
1,
198,
198,
2,
3237,
286,
262,
2456,
1276,
307,
2982,
287,
1502,
329,
428,
8265,
284,
307,
10945,
1... | 3.846154 | 52 |
data = [1, 2, 3, 4, 5, 6, 7]
low, high = 3, 6
result = sum(low <= x < high for x in data)
print(result)
| [
7890,
796,
685,
16,
11,
362,
11,
513,
11,
604,
11,
642,
11,
718,
11,
767,
60,
198,
9319,
11,
1029,
796,
513,
11,
718,
198,
20274,
796,
2160,
7,
9319,
19841,
2124,
1279,
1029,
329,
2124,
287,
1366,
8,
198,
198,
4798,
7,
20274,
... | 2.234043 | 47 |
"""
Unittest for union_find module
"""
from alg.union_find import UnionFind
| [
37811,
198,
3118,
715,
395,
329,
6441,
62,
19796,
8265,
198,
37811,
628,
198,
6738,
435,
70,
13,
24592,
62,
19796,
1330,
4479,
16742,
628,
198
] | 3.076923 | 26 |
#!/usr/bin/python
import requests, pprint
from rabbitgetapi import build_parser
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
7007,
11,
279,
4798,
198,
6738,
22746,
1136,
15042,
1330,
1382,
62,
48610,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.904762 | 42 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... | [
171,
119,
123,
2,
16529,
1783,
10541,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
5964,
1321,
13,
198,
2,
16529,
... | 2.317885 | 7,056 |
#!/usr/bin/env python
from django.db import models
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
628,
198
] | 2.944444 | 18 |
#
# -*- coding: utf-8 -*-
#
# This file is part of reclass (http://github.com/madduck/reclass)
#
# Copyright © 2007–14 martin f. krafft <madduck@madduck.net>
# Released under the terms of the Artistic Licence 2.0
#
from __future__ import absolute_import
from __future__ import division
from __future__ import print_funct... | [
2,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
302,
4871,
357,
4023,
1378,
12567,
13,
785,
14,
9937,
646,
694,
14,
260,
4871,
8,
198,
2,
198,
2,
15069,
10673,
4343,
... | 2.149165 | 838 |
# -*- coding: utf-8 -*-
# @Time : 2020-02-01 21:51
# @Author : Enjoy Zhao
from general.core import GrEexception
from general.trainer import Trainer
from general.agents.dqn import DQN
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
220,
220,
220,
1058,
12131,
12,
2999,
12,
486,
2310,
25,
4349,
198,
2,
2488,
13838,
220,
1058,
18179,
29436,
198,
198,
6738,
2276,
13,
7295,
1330,
1902,... | 2.724638 | 69 |
from game_map.game_map import GameMap
from game_map.rect import Rect
from random import randint
class TutorialDungeon:
"""
Generate a dungeon using the algorithm from the RogueBasin tutorial
Source: http://www.roguebasin.com/index.php?title=Complete_Roguelike_Tutorial,_using_python%2Blibtcod,_part_3
... | [
6738,
983,
62,
8899,
13,
6057,
62,
8899,
1330,
3776,
13912,
198,
6738,
983,
62,
8899,
13,
2554,
1330,
48599,
198,
198,
6738,
4738,
1330,
43720,
600,
628,
198,
4871,
36361,
30128,
6281,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
2... | 2.068585 | 2,085 |
'''
Main application and routing logic for miniapp (application configuration
and routing logic)
'''
from flask import Flask, render_template, request
from .models import DB, User, Tweet
from decouple import config
def create_app():
'''Create and configure an instance of the Flask application
'''
app = Fl... | [
7061,
6,
198,
13383,
3586,
290,
28166,
9156,
329,
949,
544,
381,
357,
31438,
8398,
198,
392,
28166,
9156,
8,
198,
7061,
6,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
198,
6738,
764,
27530,
1330,
20137,
11,
11787,
... | 2.842365 | 203 |
import torch
import os, glob
from torchvision import transforms
import matplotlib.pyplot as plt
import cv2
_crop = transforms.Compose([
transforms.ToPILImage(),
transforms.Resize((224, 224))
])
_normalize = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.40... | [
11748,
28034,
201,
198,
11748,
28686,
11,
15095,
201,
198,
6738,
28034,
10178,
1330,
31408,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
11748,
269,
85,
17,
201,
198,
201,
198,
62,
31476,
796,
31408,
13... | 2.588235 | 136 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import signal
import sys
import time
import RPi.GPIO as GPIO
import paho.mqtt.client as mqtt
led = 4
buzzer = 18
INTERVAL = 0.2
CODES = {
'A': '.-',
'B': '-...',
'C': '-.-.',
'D': '-..',
'E': '.',
'F': '..-.',
'G': '--.',
'H': '....',
'I'... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
6737,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
11748,
279,
1710... | 1.877729 | 687 |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import... | [
2,
19617,
28,
40477,
12,
23,
198,
81,
37811,
198,
1212,
2438,
373,
7560,
416,
198,
59,
1220,
4808,
220,
220,
220,
4808,
220,
4808,
91,
220,
220,
4808,
220,
4808,
198,
930,
44104,
8,
11139,
28264,
5769,
62,
91,
11139,
91,
930,
7,
... | 2.897872 | 235 |
#!/usr/bin/env python3
# Python implementations of HALCON's radial distortion models.
# These are intended to work both element-wise for numpy arrays,
# and also for scalars.
# Transcribed from the documentation for the "calibrate_cameras" HALCON operator.
#
# I performed some manual common subexpresson elimination si... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
11361,
25504,
286,
42968,
10943,
338,
44503,
25100,
4981,
13,
198,
2,
2312,
389,
5292,
284,
670,
1111,
5002,
12,
3083,
329,
299,
32152,
26515,
11,
198,
2,
290,
635,
329,
... | 2.598835 | 3,263 |
"""
Hold/UnHold operator credentials.
When creating a db user account to manage holds it is advised
that you create the account with roles limited to updating/writing on
the Holds collection and find only on the Member collection.
"""
USER = ''
PASSWORD = ''
| [
37811,
198,
26807,
14,
3118,
26807,
10088,
18031,
13,
198,
198,
2215,
4441,
257,
20613,
2836,
1848,
284,
6687,
6622,
340,
318,
13030,
198,
5562,
345,
2251,
262,
1848,
351,
9176,
3614,
284,
19698,
14,
16502,
319,
198,
1169,
9340,
82,
4... | 4.126984 | 63 |
# Generated by Django 3.2 on 2021-05-13 22:19
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
319,
33448,
12,
2713,
12,
1485,
2534,
25,
1129,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.892857 | 28 |
# This entrypoint file to be used in development. Start by reading README.md
import budget
from budget import create_spend_chart
from unittest import main
food = budget.Category("Food")
food.deposit(1000, "initial deposit")
food.withdraw(10.15, "groceries")
food.withdraw(15.89, "restaurant and more food for dessert")
... | [
2,
770,
5726,
4122,
2393,
284,
307,
973,
287,
2478,
13,
7253,
416,
3555,
20832,
11682,
13,
9132,
198,
11748,
4466,
198,
6738,
4466,
1330,
2251,
62,
2777,
437,
62,
40926,
198,
6738,
555,
715,
395,
1330,
1388,
198,
198,
19425,
796,
44... | 3.120536 | 224 |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 27 11:57:08 2019
@author: Nour
"""
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 25 20:57:49 2019
@author: Nour
"""
import math
import numpy as np
from matplotlib import pyplot as plt
import argparse
import os
parser = argparse.ArgumentParser(descri... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
3300,
5267,
2681,
1367,
25,
3553,
25,
2919,
13130,
201,
198,
201,
198,
31,
9800,
25,
399,
454,
201,
198,
37811,
201,
198,
201,
198,
... | 2.199446 | 1,083 |
from copy import copy
from typing import Tuple
from pysketcher._curve import Curve
from pysketcher._point import Point
class Line(Curve):
"""A representation of a line primitive.
Args:
start: The starting point of the line.
end: The end point of the line.
Example:
>>> a = ps.Lin... | [
6738,
4866,
1330,
4866,
198,
6738,
19720,
1330,
309,
29291,
198,
198,
6738,
279,
893,
7126,
2044,
13557,
22019,
303,
1330,
46300,
198,
6738,
279,
893,
7126,
2044,
13557,
4122,
1330,
6252,
628,
198,
4871,
6910,
7,
26628,
303,
2599,
198,
... | 2.259142 | 1,586 |
import discord
from discord.ext import commands
import scrimdb as db
import message_helper as msg
import logging
| [
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
11748,
32157,
9945,
355,
20613,
198,
11748,
3275,
62,
2978,
525,
355,
31456,
198,
11748,
18931,
628,
628,
198
] | 4.034483 | 29 |
import unittest
from fddc.annex_a.merger.matcher import match_data_sources, MatchedSheet
from fddc.annex_a.merger.configuration import SourceConfig
from fddc.annex_a.merger.workbook_util import WorkSheetDetail
| [
11748,
555,
715,
395,
198,
198,
6738,
277,
1860,
66,
13,
272,
12413,
62,
64,
13,
647,
1362,
13,
6759,
2044,
1330,
2872,
62,
7890,
62,
82,
2203,
11,
6550,
1740,
3347,
316,
198,
6738,
277,
1860,
66,
13,
272,
12413,
62,
64,
13,
647... | 2.753247 | 77 |
from floodsystem import geo, stationdata
def test_within_radius_true():
"""test the function to see if a station that is known to be within a certain radius is in the output"""
stations = geo.stations_within_radius(stationdata.build_station_list(), (52.2053, 0.1218), 10)
assert 'Girton' in [s.name for s in... | [
6738,
6947,
10057,
1330,
40087,
11,
4429,
7890,
198,
198,
4299,
1332,
62,
33479,
62,
42172,
62,
7942,
33529,
198,
220,
220,
220,
37227,
9288,
262,
2163,
284,
766,
611,
257,
4429,
326,
318,
1900,
284,
307,
1626,
257,
1728,
16874,
318,
... | 3.158416 | 202 |
"""Unit test package for rpi_sidecar."""
| [
37811,
26453,
1332,
5301,
329,
374,
14415,
62,
1589,
7718,
526,
15931,
198
] | 3.153846 | 13 |
#!/usr/bin/env python
"""
Advent of Code 2017: Day 13 Part 2
https://adventofcode.com/2017/day/13
"""
import sys, itertools
with open(sys.argv[1], 'r') as file:
input_list = [[int(num) for num in line.split(': ')] for line in file.readlines()]
success = False
# Increment a delay starting from 0
for delay in iter... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
2782,
1151,
286,
6127,
2177,
25,
3596,
1511,
2142,
362,
198,
5450,
1378,
324,
1151,
1659,
8189,
13,
785,
14,
5539,
14,
820,
14,
1485,
198,
37811,
198,
198,
11748,
25... | 2.588517 | 209 |
import numpy as np
import argparse
import cv2
args={}
"""
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="Path to the image")
args = vars(ap.parse_args())
"""
args["image"] = "images\jp.png"
image = cv2.imread(args["image"])
cv2.imshow("original", image)
cv2.waitKey()
#Create a r... | [
11748,
299,
32152,
355,
45941,
198,
11748,
1822,
29572,
198,
11748,
269,
85,
17,
198,
198,
22046,
34758,
92,
198,
37811,
198,
499,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
499,
13,
2860,
62,
49140,
7203,
12,
72,
1600,
366,... | 2.556634 | 618 |
import numpy as np
import hashlib
import numba
import struct
import sys
from . import glob_var
# w stands for wrapper. This is an external class that is used to interact with the environment, read, write etc
# for fast operations, we use n_motif, an internal class that is compatible with numba
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
12234,
8019,
198,
11748,
997,
7012,
198,
11748,
2878,
198,
11748,
25064,
198,
198,
6738,
764,
1330,
15095,
62,
7785,
628,
220,
220,
220,
1303,
266,
6296,
329,
29908,
13,
770,
318,
281,
7097,
... | 3.153266 | 796 |
import tensorflow as tf
def huber_loss(x, delta=1.0):
"""Reference: https://en.wikipedia.org/wiki/Huber_loss"""
return tf.where(
tf.abs(x) < delta,
tf.square(x) * 0.5,
delta * (tf.abs(x) - 0.5 * delta)
)
def take_vector_elements(vectors, indices):
"""
For a batch of vec... | [
11748,
11192,
273,
11125,
355,
48700,
628,
198,
198,
4299,
289,
18478,
62,
22462,
7,
87,
11,
25979,
28,
16,
13,
15,
2599,
198,
220,
220,
220,
37227,
26687,
25,
3740,
1378,
268,
13,
31266,
13,
2398,
14,
15466,
14,
39,
18478,
62,
22... | 2.366906 | 278 |
# -*- coding: utf-8 -*-
import copy
import functools
from rest_framework import status as http_status
import json
import logging
import os
from flask import request, make_response
from mako.lookup import TemplateLookup
from mako.template import Template
import markupsafe
from werkzeug.exceptions import NotFound
impor... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
4866,
198,
11748,
1257,
310,
10141,
198,
6738,
1334,
62,
30604,
1330,
3722,
355,
2638,
62,
13376,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,... | 2.386517 | 6,675 |
from datetime import datetime
@interceptor(
before=lambda:print('Before executing ....'),
after=lambda:print('After executing ....'),
onSuccess=lambda *x: print('Result =>',*x),
onError=lambda *x:print(*x))
SayHello()
if __name__ == '__main__':
print('Hello main ....!')
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
31,
3849,
49492,
7,
198,
220,
220,
220,
878,
28,
50033,
25,
4798,
10786,
8421,
23710,
19424,
33809,
198,
220,
220,
220,
706,
28,
50033,
25,
4798,
10786,
3260,
23710,
19424,
33809,
198,
220... | 2.872549 | 102 |
BOT_NAME = "<bot name>"
CHNL_NAME = "<YOUR streaming channel name>"
APP_ID = '<app id of the bot>'
APP_SCRT = '<app secret of the bot>'
BOT_ID = "<bot id of the bot>"
BOT_TOKEN = "<bot token of the bot>"
| [
33,
2394,
62,
20608,
796,
33490,
13645,
1438,
24618,
198,
3398,
32572,
62,
20608,
796,
33490,
56,
11698,
11305,
6518,
1438,
24618,
198,
24805,
62,
2389,
796,
705,
27,
1324,
4686,
286,
262,
10214,
29,
6,
198,
24805,
62,
6173,
14181,
79... | 2.582278 | 79 |
### Population ###
population = {
"time_values": "1750, 1760, 1770, 1780, 1790, 1800, 1810, 1820, 1830, 1840, 1850, 1860, 1870, 1880, 1890, 1900, 1910, \
1920, 1930, 1940, 1950, 1960, 1970, 1980, 1990, 2000, 2010",
"data_unit": "number of people",
"data_scale": 9,
"description": "Pop... | [
21017,
20133,
44386,
198,
39748,
796,
1391,
198,
220,
220,
220,
366,
2435,
62,
27160,
1298,
366,
1558,
1120,
11,
1596,
1899,
11,
1596,
2154,
11,
1596,
1795,
11,
1596,
3829,
11,
21431,
11,
1248,
940,
11,
1248,
1238,
11,
45440,
11,
47... | 1.834538 | 32,110 |
"""
Copyright 2022 Ovizro
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | [
37811,
198,
15269,
33160,
46941,
528,
305,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
1639,
74... | 2.969027 | 678 |
import logging
import numpy as np
import unittest
from tests import fixtures
from climate_indices import palmer
#-----------------------------------------------------------------------------------------------------------------------
# disable logging messages
logging.disable(logging.CRITICAL)
#-----------... | [
11748,
18931,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
555,
715,
395,
201,
198,
201,
198,
6738,
5254,
1330,
34609,
201,
198,
6738,
4258,
62,
521,
1063,
1330,
6340,
647,
201,
198,
201,
198,
2,
10097,
3880,
19351,
6329,... | 1.718606 | 7,374 |
from twisted.words.protocols import irc
from twisted.internet import reactor, protocol
import decrypt
import requests
import json
| [
6738,
19074,
13,
10879,
13,
11235,
4668,
82,
1330,
220,
1980,
198,
6738,
19074,
13,
37675,
1330,
21905,
11,
8435,
198,
11748,
42797,
198,
11748,
7007,
198,
11748,
33918,
628,
198
] | 4.258065 | 31 |
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: Drop_duplicate.py
Description : 利用pandas去除csv的重复行
Author : charlesXu
date: 2019/1/11
-------------------------------------------------
Change Activity: 2019/1/11:
-------------------------------... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
47232,
12,
198,
220,
220,
9220,
6530,
171,
120,
248,
220,
220,
220,
220,
14258,
62,
646,
489,
5344,
13,
9078,
198,
220,
220,
12489,
1058,
220,
220,
... | 2.120805 | 596 |
from __future__ import annotations
from prettyqt import positioning
from prettyqt.qt import QtPositioning
QtPositioning.QGeoCircle.__bases__ = (positioning.GeoShape,)
if __name__ == "__main__":
coord = (1, 1)
circle = GeoCircle(coord)
print(str(circle))
print(repr(circle))
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
2495,
39568,
1330,
22097,
198,
6738,
2495,
39568,
13,
39568,
1330,
33734,
26545,
278,
628,
198,
48,
83,
26545,
278,
13,
48,
10082,
78,
31560,
293,
13,
834,
65,
1386,
834,
796,
357,... | 2.766355 | 107 |
#!/usr/bin/env python3
# Copyright (c) 2020 Jan Magrot
import time
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
66,
8,
12131,
2365,
2944,
10599,
198,
198,
11748,
640,
628,
628
] | 2.84 | 25 |
# File: benchmark.py
import json
import os
import string
import logging
import sys
import csv
from pathlib import Path
logging.basicConfig(format='[ %(levelname)s ] %(message)s',level=logging.DEBUG)
from common_demo import banner,terminal_clean,existCheck_downloader,model_info_ckeck
logging.disable(logging.DEBUG)
cur... | [
2,
9220,
25,
18335,
13,
9078,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
4731,
220,
198,
11748,
18931,
198,
11748,
25064,
198,
11748,
269,
21370,
198,
6738,
3108,
8019,
1330,
10644,
198,
6404,
2667,
13,
35487,
16934,
7,
18982,
11... | 2.760784 | 255 |
#!/usr/bin/env python
#import plotGlobalEndemicBehaviour
import matplotlib.pyplot as plt
from BVDDataAnalyzer import outputSpec as outputSpec
import BVDDataAnalyzer
import numpy as np
import sys
import os
analyzer = BVDDataAnalyzer.Analyzer.SimulationAnalyzer(sys.argv[1])
breedData = analyzer.getBreedingDynamicsStats... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
11748,
7110,
22289,
12915,
5314,
25267,
37716,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
347,
8898,
6601,
37702,
9107,
1330,
5072,
22882,
355,
5072,
228... | 2.625793 | 946 |
import json
import io
import base64
import uuid
from typing import TypeVar
from flask import url_for, escape
HTML = TypeVar('HTML')
def get_resources():
"""Fetch local resource file"""
BOOTSTRAP = url_for('static', filename='bootstrap.min.css')
DARKLY = url_for('static', filename='bootstrap.da... | [
11748,
33918,
198,
11748,
33245,
198,
11748,
2779,
2414,
198,
11748,
334,
27112,
198,
6738,
19720,
1330,
5994,
19852,
198,
198,
6738,
42903,
1330,
19016,
62,
1640,
11,
6654,
198,
198,
28656,
796,
5994,
19852,
10786,
28656,
11537,
628,
198... | 2.232225 | 3,910 |
#!/usr/bin/env python3
from fits import Spectrum
import pandas as pd
import scipy as sp
import matplotlib.pyplot as plt
from astropy import stats
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import Imputer
from sklearn.ensemble import RandomForestClassifier
#... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
11414,
1330,
27217,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
629,
541,
88,
355,
599,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6... | 2.597978 | 1,286 |
# USAGE
# python ball_tracking.py
# import the necessary packages
from collections import deque
from imutils.video import VideoStream
import numpy as np
import argparse
import cv2
import imutils
import depthai as dai
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
... | [
2,
1294,
11879,
201,
198,
2,
21015,
2613,
62,
36280,
13,
9078,
201,
198,
201,
198,
2,
1330,
262,
3306,
10392,
201,
198,
6738,
17268,
1330,
390,
4188,
201,
198,
6738,
545,
26791,
13,
15588,
1330,
7623,
12124,
201,
198,
11748,
299,
32... | 2.19951 | 2,451 |
from django.contrib.auth.models import User
from django.test import TestCase
from django_dynamic_fixture import get
from readthedocs.audit.models import AuditLog
from readthedocs.organizations.models import Organization, OrganizationOwner
from readthedocs.projects.models import Project
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
62,
67,
28995,
62,
69,
9602,
1330,
651,
198,
198,
6738,
1100,
83,
704,
420,
82,
13,
... | 3.6125 | 80 |
from .datasets import read_dataset
__all__ = ['read_dataset'] | [
6738,
764,
19608,
292,
1039,
1330,
1100,
62,
19608,
292,
316,
198,
198,
834,
439,
834,
796,
37250,
961,
62,
19608,
292,
316,
20520
] | 2.583333 | 24 |
from base64 import b64encode
import os
import pickle
from pyramid.config import Configurator
from pyramid.response import Response
from pyramid.view import exception_view_config
from webtest import TestApp
from pyramid_oas3 import ValidationErrors, ResponseValidationError
_last_exception = None
@exception_view_... | [
6738,
2779,
2414,
1330,
275,
2414,
268,
8189,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
198,
6738,
27944,
13,
11250,
1330,
17056,
333,
1352,
198,
6738,
27944,
13,
26209,
1330,
18261,
198,
6738,
27944,
13,
1177,
1330,
6631,
62,
1177... | 3.590909 | 110 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 - 2020 -- Lars Heuer
# All rights reserved.
#
# License: BSD License
#
"""\
Test against issue #3.
<https://github.com/heuer/segno/issues/3>
"""
from __future__ import unicode_literals, absolute_import
import io
import segno
try:
from .tutils import matrix_looks_valid
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
66,
8,
1584,
532,
12131,
1377,
31239,
679,
15573,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
13789,
25,
347,
10305,
13789,
198,
2,
198,
... | 2.819149 | 188 |
import mxnet as mx
import numpy as np
import argparse
if __name__ == '__main__':
args = parse_args()
img_iter = get_iter(
args.imgrec_path,
args.imglist_path,
args.label_width,
args.batch_size,
args.mean_value)
devs = [mx.gpu(int(x)) for x in args.devs.split(",")... | [
11748,
285,
87,
3262,
355,
285,
87,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1822,
29572,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
26498,
796,
21136,
62,
22046,
3419,
198... | 2.055556 | 270 |
# Copyright 2019 The Forte Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [
2,
15069,
13130,
383,
6401,
68,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
2... | 2.570558 | 985 |
from htd import parse
| [
6738,
289,
8671,
1330,
21136,
628
] | 3.833333 | 6 |
#
# Copyright 2019-20 General Electric Company
#
#
# 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 ag... | [
2,
198,
2,
15069,
13130,
12,
1238,
3611,
13944,
5834,
198,
2,
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,
... | 2.453811 | 1,732 |
# youtube-search-requests
# async_session.py
import aiohttp
import random
import asyncio
import json
import warnings
from youtube_search_requests.constants import USER_AGENT_HEADERS, BASE_YOUTUBE_URL
from youtube_search_requests.utils import (
parse_json_async_session_data,
# check_valid_regions, # ... | [
2,
35116,
12,
12947,
12,
8897,
3558,
201,
198,
2,
30351,
62,
29891,
13,
9078,
201,
198,
201,
198,
11748,
257,
952,
4023,
201,
198,
11748,
4738,
201,
198,
11748,
30351,
952,
201,
198,
11748,
33918,
201,
198,
11748,
14601,
201,
198,
6... | 2.314829 | 1,315 |
from collections import namedtuple
AST = namedtuple('AST', ['fsms'])
FSM = namedtuple('FSM', ['name', 'hosts', 'gather_facts', 'roles', 'states', 'outputs', 'import_from'])
State = namedtuple('State', ['name', 'handlers'])
Handler = namedtuple('Handler', ['name', 'body'])
| [
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
11262,
796,
3706,
83,
29291,
10786,
11262,
3256,
37250,
9501,
907,
6,
12962,
198,
10652,
44,
796,
3706,
83,
29291,
10786,
10652,
44,
3256,
37250,
3672,
3256,
705,
4774,
82,
3256,
705,
... | 2.835052 | 97 |
"""
TODO:
Functions for interacting with api's
Send and receive coins
"""
import hashlib
import secrets
from typing import Tuple
from utils.secp256k1 import b58_encode, point_mul
if __name__ == "__main__":
w = Wallet()
print(w.generate_address())
| [
37811,
198,
51,
3727,
46,
25,
198,
220,
220,
220,
40480,
329,
24986,
351,
40391,
338,
198,
220,
220,
220,
16290,
290,
3328,
10796,
198,
37811,
198,
198,
11748,
12234,
8019,
198,
11748,
13141,
198,
6738,
19720,
1330,
309,
29291,
198,
1... | 2.762887 | 97 |