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 python
# coding: utf8
import sys
import json
import time
import requests
from config import *
if __name__ == '__main__':
if len(sys.argv) > 1:
selector = sys.argv[1]
if selector in ['schoolspecialindex', 'school']:
exec 'crawl_%s()' % selector
exit(0)
p... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
23,
198,
198,
11748,
25064,
198,
11748,
33918,
198,
11748,
640,
198,
11748,
7007,
198,
198,
6738,
4566,
1330,
1635,
198,
198,
361,
11593,
3672,
834,
6624,
705,
... | 2.35443 | 158 |
"""
ccextractor-web | parsers.py
Author : Saurabh Shrivastava
Email : saurabh.shrivastava54+ccextractorweb[at]gmail.com
Link : https://github.com/saurabhshri
"""
import json
import argparse
| [
37811,
198,
66,
344,
742,
40450,
12,
12384,
930,
13544,
364,
13,
9078,
198,
198,
13838,
220,
220,
1058,
46197,
397,
71,
911,
15104,
459,
4170,
198,
15333,
220,
220,
220,
1058,
473,
333,
397,
71,
13,
1477,
15104,
459,
4170,
4051,
10,... | 2.372093 | 86 |
# --------------
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#df=pd.DataFrame()
data=pd.read_csv(path)
loan_status=data['Loan_Status'].value_counts().plot(kind="bar")
plt.show()
data.iloc[25,1]
data.iloc[53,9]
property_and_loan=data.groupby(['Property_Area', 'Loan_Status']).size(... | [
2,
220,
26171,
198,
11748,
299,
32152,
355,
45941,
220,
201,
198,
11748,
19798,
292,
355,
279,
67,
220,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
2,
7568,
28,
30094,
13,
6601,
19778,
3419,
201,
198... | 2.416514 | 545 |
#
# PySNMP MIB module H3C-IPSEC-MONITOR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/H3C-IPSEC-MONITOR-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:09:33 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
367,
18,
34,
12,
47643,
2943,
12,
27857,
2043,
1581,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,... | 2.243519 | 19,095 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
201,
198,
201,
198
] | 3.083333 | 12 |
#
# A permutation is an ordered arrangement of objects.
# For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4.
#
# If all of the permutations are listed numerically or alphabetically,
# we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are:
#
# 012 021 102 1... | [
2,
201,
198,
2,
317,
9943,
7094,
318,
281,
6149,
13888,
286,
5563,
13,
201,
198,
2,
1114,
1672,
11,
513,
17464,
318,
530,
1744,
9943,
7094,
286,
262,
19561,
352,
11,
362,
11,
513,
290,
604,
13,
201,
198,
2,
201,
198,
2,
1002,
... | 2.739377 | 353 |
from . import lcd
import platform
import sys
# for development purposes (I always use MacOS)
if platform.system() == "Darwin":
import fake_rpi
sys.modules["RPi"] = fake_rpi.RPi
sys.modules["RPi.GPIO"] = fake_rpi.RPi.GPIO
import RPi.GPIO as GPIO
class BaseRPi:
""" Base class to be inherited by childr... | [
6738,
764,
1330,
300,
10210,
198,
11748,
3859,
198,
11748,
25064,
198,
198,
2,
329,
2478,
4959,
357,
40,
1464,
779,
4100,
2640,
8,
198,
361,
3859,
13,
10057,
3419,
6624,
366,
32708,
5404,
1298,
198,
220,
220,
220,
1330,
8390,
62,
81... | 2.441592 | 779 |
# inspired from:
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
# fmt: off
__title__ = "spacy"
__version__ = "2.1.6"
__summary__ = "Industrial-strength Natural Language Processing (NLP) with Python and Cython... | [
2,
7867,
422,
25,
198,
2,
3740,
1378,
29412,
12,
8002,
3039,
12,
7220,
12,
41311,
13,
961,
83,
704,
420,
82,
13,
2398,
14,
268,
14,
42861,
14,
29762,
62,
10459,
62,
9641,
14,
198,
2,
3740,
1378,
12567,
13,
785,
14,
79,
4464,
6... | 2.879377 | 257 |
# This is a modified version of the training script of https://github.com/nii-yamagishilab/mos-finetune-ssl
import os
import argparse
import fairseq
import torch
import torchaudio
import torch.nn as nn
import torch.optim as optim
import time
import json
from torch.utils.data.dataset import Dataset
from torch.utils.dat... | [
2,
770,
318,
257,
9518,
2196,
286,
262,
3047,
4226,
286,
3740,
1378,
12567,
13,
785,
14,
77,
4178,
12,
88,
321,
363,
680,
346,
397,
14,
16785,
12,
15643,
316,
1726,
12,
45163,
198,
198,
11748,
28686,
198,
11748,
1822,
29572,
198,
... | 3.035897 | 195 |
import tkinter as tk
from tkinter.filedialog import askopenfilename, asksaveasfilename
# App functions
#Opening files
#Saving files
# Format functions
# def cut_line
# def copy_line
# def paste_line
window = tk.Tk()
window.title('Noted')
#app.iconbitmap('path/to/ico/icon.ico')
window.rowconfigure(0, minsize=... | [
11748,
256,
74,
3849,
355,
256,
74,
198,
6738,
256,
74,
3849,
13,
69,
3902,
498,
519,
1330,
1265,
9654,
34345,
11,
7893,
1015,
292,
34345,
198,
198,
2,
2034,
5499,
198,
198,
2,
43093,
3696,
198,
198,
2,
50,
2703,
3696,
198,
220,
... | 2.3776 | 625 |
import dataclasses
import logging
from typing import Iterable, Optional
import pytorch_lightning as pl
import torch
import torch.nn
import torch.nn.functional as F
import torch.nn.init
from . import generators, sampling, encoding
_logger = logging.getLogger("pytorch_lightning")
_logger.setLevel(logging.INFO)
def w... | [
11748,
4818,
330,
28958,
198,
11748,
18931,
198,
6738,
19720,
1330,
40806,
540,
11,
32233,
198,
198,
11748,
12972,
13165,
354,
62,
2971,
768,
355,
458,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
198,
11748,
28034,
13,
20471,
13,
4... | 2.413408 | 1,074 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'calculator.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, Q... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
5178,
7822,
7560,
422,
3555,
334,
72,
2393,
705,
9948,
3129,
1352,
13,
9019,
6,
198,
2,
198,
2,
15622,
416,
25,
9485,
48,
83,
20,
12454,
2438,
17301,
642,
... | 3.036036 | 111 |
from template import app
@app.route('/swag')
@app.route('/swag/')
| [
6738,
11055,
1330,
598,
198,
198,
31,
1324,
13,
38629,
10786,
14,
2032,
363,
11537,
198,
31,
1324,
13,
38629,
10786,
14,
2032,
363,
14,
11537,
198
] | 2.481481 | 27 |
from configs.base import Configs, ProjectPath
__all__ = ['Configs', 'ProjectPath', 'cfg']
cfg = Configs()
| [
6738,
4566,
82,
13,
8692,
1330,
17056,
82,
11,
4935,
15235,
628,
198,
834,
439,
834,
796,
37250,
16934,
82,
3256,
705,
16775,
15235,
3256,
705,
37581,
20520,
628,
198,
37581,
796,
17056,
82,
3419,
198
] | 3.055556 | 36 |
#!/usr/bin/env python3
with open('game_input', 'r') as f:
#print([p for p in f.read().split('\n\n')])
#print([len(p.replace("\n", " ").split(" ")) for p in f.read().split('\n\n')])
#print([1 if len(p.replace("\n", " ").split(" ")) == 8 or \
# (len(p.replace("\n", " ").split(" ")) == 7 and ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
628,
198,
4480,
1280,
10786,
6057,
62,
15414,
3256,
705,
81,
11537,
355,
277,
25,
198,
220,
220,
220,
1303,
4798,
26933,
79,
329,
279,
287,
277,
13,
961,
22446,
35312,
10786,
59,
77,
... | 2.117497 | 783 |
import json
class Command():
"""docstring for Command"""
JOIN = 'JOIN'
START = 'START'
SUCCESSFUL_TRADE = 'SUCCESSFUL_TRADE'
CANCELLED_OFFER = 'CANCELLED_OFFER'
BOOK_EVENT = 'BOOK_EVENT'
BILLIONAIRE = 'BILLIONAIRE'
END_ROUND = 'END_ROUND'
END_GAME = 'END_GAME'
ERROR = 'ERROR'
... | [
11748,
33918,
628,
198,
4871,
9455,
33529,
198,
220,
220,
220,
37227,
15390,
8841,
329,
9455,
37811,
198,
220,
220,
220,
32357,
1268,
796,
705,
45006,
1268,
6,
198,
220,
220,
220,
33303,
796,
705,
2257,
7227,
6,
198,
220,
220,
220,
... | 1.693387 | 499 |
"""Base authorization API.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import json
import http.client
import flask
import flask_restplus as restplus
from treadmill import webutils
_LOGGER = l... | [
37811,
14881,
19601,
7824,
13,
198,
37811,
198,
198,
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,
6738,
11593,
37443,
834,
1330,
28000,
... | 2.590796 | 804 |
# 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... | 3.535211 | 284 |
choice = True
import random, string
import os
from termcolor import colored
from colorama import Fore
import requests
os.system("cls")
os.system("title NitroGen v1.3 ~ Made by viben#6633 [Menu]")
print('')
print('')
print(colored('███╗░░██╗██╗████████╗██████╗░░█████╗░ ░██████╗░███████╗███╗░░██╗', 'magenta'))
print... | [
25541,
796,
6407,
198,
198,
11748,
4738,
11,
4731,
198,
11748,
28686,
198,
6738,
3381,
8043,
1330,
16396,
198,
6738,
3124,
1689,
1330,
4558,
198,
11748,
7007,
198,
198,
418,
13,
10057,
7203,
565,
82,
4943,
198,
198,
418,
13,
10057,
72... | 1.809749 | 2,749 |
import time
import glob
import os
from twisted.internet import protocol, reactor, defer
from mk2.plugins import Plugin
from mk2.events import Hook, ServerOutput, ServerStopped, EventPriority
import shlex
| [
11748,
640,
198,
11748,
15095,
198,
11748,
28686,
198,
6738,
19074,
13,
37675,
1330,
8435,
11,
21905,
11,
29135,
198,
198,
6738,
33480,
17,
13,
37390,
1330,
42636,
198,
6738,
33480,
17,
13,
31534,
1330,
18531,
11,
9652,
26410,
11,
9652,... | 3.90566 | 53 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a ...
"""
from __future__ import unicode_literals
import codecs
import os
import re
import shutil
import sys
import tkinter as T
def get_path():
""" get Kindle path """
if sys.platform == "win32":
x = os.popen("wmic VOLUME WHERE Label='kindle... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
1212,
318,
257,
2644,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198... | 2.043388 | 2,420 |
from collections import defaultdict
table=defaultdict(str)
mod=26
insert('delhi',table)
insert('mumbai',table)
insert('kolkata',table)
insert('chennai',table)
insert('jalandhar',table)
insert('abcdefgh', table)
print(table)
search('mumbai',table)
search('varanasi',table)
search('abcdefgh',table)
| [
6738,
17268,
1330,
4277,
11600,
198,
220,
220,
220,
220,
198,
11487,
28,
12286,
11600,
7,
2536,
8,
198,
4666,
28,
2075,
198,
28463,
10786,
12381,
5303,
3256,
11487,
8,
198,
28463,
10786,
76,
21645,
3256,
11487,
8,
198,
28463,
10786,
7... | 2.831776 | 107 |
import unittest
from katas.kyu_7.some_circles import sum_circles
| [
11748,
555,
715,
395,
198,
198,
6738,
479,
265,
292,
13,
2584,
84,
62,
22,
13,
11246,
62,
66,
343,
5427,
1330,
2160,
62,
66,
343,
5427,
628
] | 2.392857 | 28 |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import ipaddress
import random
import re
import socket
import time
import weakref
from datetime import timedelta
... | [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
347,
10305,
12,
7635,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,
26... | 2.53518 | 2,743 |
r"""
Kleber Trees
A Kleber tree is a tree of weights generated by Kleber's algorithm
[Kleber1]_. The nodes correspond to the weights in the positive Weyl chamber
obtained by subtracting a (non-zero) positive root. The edges are labeled by
the coefficients of the roots of the difference.
AUTHORS:
- Travis Scrimshaw (... | [
81,
37811,
198,
42,
293,
527,
34925,
198,
198,
32,
15983,
527,
5509,
318,
257,
5509,
286,
19590,
7560,
416,
15983,
527,
338,
11862,
198,
58,
42,
293,
527,
16,
60,
44807,
383,
13760,
6053,
284,
262,
19590,
287,
262,
3967,
775,
2645,
... | 2.108942 | 25,812 |
# -*- coding: utf-8 -*-
"""
This module implements interfacing tools for the FISTA algorithm.
For further informations about the FISTA algorithm, have a look at [1]_.
.. [1] BECK, Amir et TEBOULLE, Marc. A fast iterative shrinkage-thresholding
algorithm for linear inverse problems. SIAM journal on imaging sciences... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
1212,
8265,
23986,
9556,
4092,
4899,
329,
262,
376,
1797,
5603,
11862,
13,
198,
198,
1890,
2252,
4175,
602,
546,
262,
376,
1797,
5603,
11862,
11,
423,
257,
... | 2.013867 | 3,822 |
import os
import sys
import time
import shutil
import subprocess
from collections import defaultdict
from deep_rl.utils.misc import get_time_str, mkdir
class AverageMeter(object):
"""Computes and stores the average and current value"""
class MultiTimer(object):
"""Count the time for each part of training."""... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
4423,
346,
198,
11748,
850,
14681,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
2769,
62,
45895,
13,
26791,
13,
44374,
1330,
651,
62,
2435,
62,
2536,
11,
33480,
15908,
198... | 3.659091 | 88 |
import random
print('sorteando quatro alunos para apresentar=')
nomess = ('ariana', 'carlos', 'tânia', 'olivia')
n = random.choice(nomess)
print(n)
#
#import random
#n1 = str(input('primeiro aluno:')
#n2 = str(input('segundo aluno:')
#n3 = str(input('terceiro aluno:')
#n4 = str(input('quarto aluno:')
#lista = [n1, n2, ... | [
11748,
4738,
198,
4798,
10786,
30619,
68,
25440,
627,
47756,
435,
403,
418,
31215,
2471,
2028,
283,
28,
11537,
198,
26601,
408,
796,
19203,
3699,
64,
3256,
705,
66,
7063,
418,
3256,
705,
83,
22940,
18142,
3256,
705,
349,
20817,
11537,
... | 2.269663 | 178 |
# -*- coding: utf-8-*-
"""
Basic module template.
"""
import re
SENTENCES = [
"hello {P}", "hi {P}", "good morning {P}", "good afternoon {P}",
"good evening {P}", "good day {P}"
]
def handle(text, output, profile):
"""
Responds to user-input, typically speech text, by greeting the user.
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
12,
9,
12,
198,
37811,
198,
220,
220,
220,
14392,
8265,
11055,
13,
198,
37811,
628,
198,
11748,
302,
198,
198,
50,
3525,
24181,
1546,
796,
685,
198,
220,
220,
220,
366,
31373,
1391,
47... | 2.487654 | 324 |
from typing import Callable
from deciphon_sched.sched import sched_cleanup, sched_init
from loguru import logger
from deciphon_api.core.settings import Settings
__all__ = ["create_start_handler", "create_stop_handler"]
| [
6738,
19720,
1330,
4889,
540,
198,
198,
6738,
875,
13323,
261,
62,
1416,
704,
13,
1416,
704,
1330,
6038,
62,
27773,
929,
11,
6038,
62,
15003,
198,
6738,
2604,
14717,
1330,
49706,
198,
198,
6738,
875,
13323,
261,
62,
15042,
13,
7295,
... | 3.294118 | 68 |
import os
from datetime import datetime
from flask import Blueprint
from flask import render_template, request, redirect, send_from_directory
from flask_login import login_required, current_user
from .export import export
from ..defines import names
affairs = Blueprint('affairs', __name__, template_folder='templates... | [
11748,
28686,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
42903,
1330,
39932,
198,
6738,
42903,
1330,
8543,
62,
28243,
11,
2581,
11,
18941,
11,
3758,
62,
6738,
62,
34945,
198,
198,
6738,
42903,
62,
38235,
1330,
17594,
62,
... | 3.472868 | 129 |
import numpy as np
from platypus import GeneticAlgorithm,Problem,Permutation,Insertion
# load the data for the USA 48 capital cities
# optimal value = 10628 (https://people.sc.fsu.edu/~jburkardt/datasets/tsp/tsp.html)
xy = np.loadtxt('data/tsp-48.txt')
num_cities = len(xy)
# Problem(number of decisions, number of obj... | [
11748,
299,
32152,
355,
45941,
198,
6738,
40315,
4464,
385,
1330,
42295,
2348,
42289,
11,
40781,
11,
5990,
76,
7094,
11,
44402,
295,
198,
198,
2,
3440,
262,
1366,
329,
262,
4916,
4764,
3139,
4736,
198,
2,
16586,
1988,
796,
15696,
2078... | 3.172308 | 325 |
import pickle, json
from .logger import logger
__all__ = ["logger", "aslist", "load_pickle", "load_json"]
load_pickle = lambda x: pickle.load( open( str(x), "rb" ) )
load_json = lambda x: json.load( open( str(x) ) )
| [
11748,
2298,
293,
11,
33918,
198,
6738,
764,
6404,
1362,
1330,
49706,
198,
198,
834,
439,
834,
796,
14631,
6404,
1362,
1600,
366,
292,
4868,
1600,
366,
2220,
62,
27729,
293,
1600,
366,
2220,
62,
17752,
8973,
198,
198,
2220,
62,
27729,... | 2.595238 | 84 |
# -*- coding: utf-8 -*-
import logging
from .basicanalyzer import BasicAnalyzer
class GenericAnalyzer(BasicAnalyzer):
"""Analyzer to pass a function pointer to, in order to create an analyzer on the fly"""
name = "GenericAnalyzer"
def verify(self, results):
"""Method to perform additional checks... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
18931,
198,
198,
6738,
764,
12093,
7490,
3400,
9107,
1330,
14392,
37702,
9107,
628,
198,
4871,
42044,
37702,
9107,
7,
26416,
37702,
9107,
2599,
198,
220,
220,
220,
... | 2.681128 | 461 |
# Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# pylint: disable=duplicate-code
# pylint: disable=li... | [
2,
15069,
357,
66,
8,
33448,
4013,
5276,
40778,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
770,
318,
11971,
3788,
422,
4013,
5276,
40778,
3457,
11,
329,
11247,
198,
2,
290,
8733,
2800,
534,
1664,
2775,
4706,
13,
198,
2,
220,
198,
2,... | 3.259207 | 706 |
entrada = str(input())
guardaVogais = ""
for i in entrada:
if i == "a" or i == "e" or i =="o" or i == "i" or i == "u":
guardaVogais = guardaVogais + " " + i
aux = guardaVogais
separa = aux.split(" ")
vogaisInvertidas = ""
for j in range(len(separa)-1 ,-1 , -1):
vogaisInvertidas = vogaisInvertidas ... | [
298,
81,
4763,
796,
965,
7,
15414,
28955,
198,
198,
14864,
64,
53,
10949,
271,
796,
13538,
198,
198,
1640,
1312,
287,
24481,
4763,
25,
198,
220,
220,
220,
611,
1312,
6624,
366,
64,
1,
393,
1312,
6624,
366,
68,
1,
393,
1312,
796,
... | 2.063197 | 269 |
from gevent.pywsgi import WSGIServer
from social_fabric.app import app
if __name__ == '__main__':
main() | [
6738,
4903,
1151,
13,
9078,
18504,
12397,
1330,
25290,
38,
1797,
18497,
198,
6738,
1919,
62,
36434,
1173,
13,
1324,
1330,
598,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419
] | 2.725 | 40 |
"""Top-level package for GivEnergy Modbus."""
__author__ = """Dewet Diener"""
__email__ = 'givenergy-modbus@dewet.org'
__version__ = '0.9.3'
| [
37811,
9126,
12,
5715,
5301,
329,
402,
452,
28925,
3401,
10885,
526,
15931,
198,
198,
834,
9800,
834,
796,
37227,
35,
413,
316,
6031,
877,
37811,
198,
834,
12888,
834,
796,
705,
70,
452,
22554,
12,
4666,
10885,
31,
67,
413,
316,
13,... | 2.448276 | 58 |
import pytest
import os,sys
import warnings
try:
from exceptions import Exception, TypeError, ImportError
except:
pass
from runipy.notebook_runner import NotebookRunner
wrapped_stdin = sys.stdin
sys.stdin = sys.__stdin__
sys.stdin = wrapped_stdin
try:
from Queue import Empty
except:
from queue import ... | [
11748,
12972,
9288,
198,
11748,
28686,
11,
17597,
198,
11748,
14601,
198,
28311,
25,
198,
220,
220,
220,
422,
13269,
1330,
35528,
11,
5994,
12331,
11,
17267,
12331,
198,
16341,
25,
198,
220,
220,
220,
1208,
198,
198,
6738,
1057,
541,
... | 2.664441 | 599 |
import tensorflow as tf
import numpy as np
import cv2
def decode_jpeg(image_buffer, scope=None):
"""Decode a JPEG string into one 3-D float image Tensor.
Args:
image_buffer: scalar string Tensor.
scope: Optional scope for name_scope.
Returns:
3-D float Tensor with values ranging from [0, 1).
"""
w... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
4299,
36899,
62,
73,
22071,
7,
9060,
62,
22252,
11,
8354,
28,
14202,
2599,
198,
220,
37227,
10707,
1098,
257,
48561,
4731,
656,
53... | 2.460177 | 678 |
from __future__ import absolute_import
from setuptools import setup
install_requires = [
"six>=1.12.0",
"SQLAlchemy>=1.0",
]
dev_requires = [
"autopep8>=1.4.4",
"coverage",
"flake8",
"ipdb",
"ipython",
"isort>=4.3.21",
'mock;python_version=="2.7"',
"nose",
"pip-tools",
... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
17350,
62,
47911,
796,
685,
198,
220,
220,
220,
366,
19412,
29,
28,
16,
13,
1065,
13,
15,
1600,
198,
220,
220,
220,
366,
17861,... | 2.730181 | 719 |
a = [1, 2, 5, 7, 10, 12]
print(binary_search_recursive(a, 0, len(a)-1, -1))
| [
628,
198,
64,
796,
685,
16,
11,
362,
11,
642,
11,
767,
11,
838,
11,
1105,
60,
198,
4798,
7,
39491,
62,
12947,
62,
8344,
30753,
7,
64,
11,
657,
11,
18896,
7,
64,
13219,
16,
11,
532,
16,
4008,
198
] | 1.926829 | 41 |
"""This module describes Invader's behaviour. """
import asyncio
import logging
from random import randint
from gamepad.unit import Unit
from simple_commander.utils.constants import DEFAULT_SPEED, STEP_INTERVAL, UNITS
from simple_commander.game.bullet import Bullet
| [
37811,
1212,
8265,
8477,
10001,
5067,
338,
9172,
13,
37227,
198,
198,
11748,
30351,
952,
198,
11748,
18931,
198,
198,
6738,
4738,
1330,
43720,
600,
198,
198,
6738,
983,
15636,
13,
20850,
1330,
11801,
198,
6738,
2829,
62,
9503,
4066,
13,... | 3.684932 | 73 |
import src.utils.messages as msg
from src.commands.base_command import BaseCommand
| [
11748,
12351,
13,
26791,
13,
37348,
1095,
355,
31456,
198,
6738,
12351,
13,
9503,
1746,
13,
8692,
62,
21812,
1330,
7308,
21575,
628
] | 3.652174 | 23 |
"""
this file has three classes. All the classes are related to tracking clients that are in range
RegistryEvent
RegisteredClientRegistry
RegistryEventHandler
"""
from simplesensor.shared import ThreadsafeLogger
from .btleRegisteredClient import BtleRegisteredClient
import os
import os.path
import logging
import lo... | [
37811,
198,
5661,
2393,
468,
1115,
6097,
13,
220,
1439,
262,
6097,
389,
3519,
284,
9646,
7534,
326,
389,
287,
2837,
198,
198,
8081,
4592,
9237,
198,
47473,
11792,
8081,
4592,
198,
8081,
4592,
9237,
25060,
198,
198,
37811,
198,
198,
67... | 4.107143 | 84 |
from emoji import emojize
| [
6738,
44805,
1330,
795,
13210,
1096,
628
] | 3.857143 | 7 |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 26 15:15:55 2018
@author: Madhur Kashyap 2016EEZ8350
"""
import os
import sys
import logging
from keras.optimizers import Adam
prog = os.path.basename(__file__)
codedir = os.path.join(os.path.dirname(__file__),"..","code")
sys.path.append(codedir)
from ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
26223,
2758,
2608,
1315,
25,
1314,
25,
2816,
2864,
201,
198,
201,
198,
31,
9800,
25,
4627,
48349,
20578,
88,
499,
1584,
6500,
57,
599... | 2.021888 | 731 |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
#
# 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/LICEN... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
2864,
383,
3012,
9552,
15417,
4816,
46665,
290,
383,
12905,
2667,
32388,
3457,
13,
1074,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
... | 2.85535 | 1,673 |
from tkinter import*
mw = Tk()
mw = Spinbox(mw)
mw.pack()
mainloop()
| [
6738,
256,
74,
3849,
1330,
9,
201,
198,
76,
86,
796,
309,
74,
3419,
201,
198,
76,
86,
796,
28002,
3524,
7,
76,
86,
8,
201,
198,
76,
86,
13,
8002,
3419,
201,
198,
12417,
26268,
3419,
201,
198
] | 1.897436 | 39 |
"""Foreground Farm
Farm aproach: Move the mouse in the screen and watch if the enemy life's bar appears, then
click in the mob to attack it. Doesn't work very well.
"""
# region Imports
import time
from pyfiglet import Figlet
from pynput.mouse import Listener as MouseListener
import keyboard
import pyautog... | [
37811,
16351,
2833,
11272,
201,
198,
201,
198,
48412,
257,
1676,
620,
25,
10028,
262,
10211,
287,
262,
3159,
290,
2342,
611,
262,
4472,
1204,
338,
2318,
3568,
11,
788,
201,
198,
12976,
287,
262,
7251,
284,
1368,
340,
13,
28048,
470,
... | 2.483444 | 453 |
from django.urls import re_path
from .consumers import *
websocket_urlpatterns = [
re_path(r'ws/chat/(?P<room_id>\w+)/$', ChatConsumer.as_asgi()),
] | [
6738,
42625,
14208,
13,
6371,
82,
1330,
302,
62,
6978,
198,
198,
6738,
764,
5936,
31260,
1330,
1635,
198,
198,
732,
1443,
5459,
62,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
302,
62,
6978,
7,
81,
6,
18504,
14,
17006,
29006,
3... | 2.298507 | 67 |
from gym_oculoenv.oculo.gym_oculoenv import GymOculoEnv
| [
6738,
11550,
62,
420,
377,
6571,
85,
13,
420,
43348,
13,
1360,
76,
62,
420,
377,
6571,
85,
1330,
31187,
46,
3129,
78,
4834,
85,
198
] | 2.153846 | 26 |
from __future__ import division
from itertools import combinations
import numpy as np
import pandas as pd
import scipy.integrate
from statsmodels.tools.tools import ECDF
from sklearn import preprocessing
import seaborn as sns
| [
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
340,
861,
10141,
1330,
17790,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
629,
541,
88,
13,
18908,
4873,
198,
6738,
9756,
27530,
13,
31391,
13,
... | 3.352113 | 71 |
import os
from copy import deepcopy
file_path = os.path.join(os.path.dirname(__file__), "input.txt")
with open(file_path, 'r') as input:
all_lines = input.readlines()
for i in range(len(all_lines)):
all_lines[i] = all_lines[i].strip('\n')
all_lines[i] = list(all_lines[i])
adjacencies = [(-1, -1), (-1... | [
11748,
28686,
198,
6738,
4866,
1330,
2769,
30073,
628,
628,
198,
7753,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
366,
15414,
13,
14116,
4943,
198,
198,
4480,
1280,
7,
7753,... | 2.47619 | 315 |
import time
from datetime import datetime as dt
# hosts Files
# Windows c:\\windows\sistem32\drivers\etc
# Mac & Linux /etc/hosts
HOSTS_PATH_WINDOWS = r'C:\Windows\System32\drivers\etc\
hosts'
HOSTS_UNIX_WINDOWS = '/etc/hosts'
HOST_DIR = "hosts"
REDIRECT = "127.0.0.1"
websites_list = [
"www.facebook.com",
"... | [
11748,
640,
220,
198,
6738,
4818,
8079,
1330,
4818,
8079,
355,
288,
83,
198,
198,
2,
11453,
13283,
198,
2,
3964,
269,
25,
6852,
28457,
59,
82,
396,
368,
2624,
59,
36702,
59,
14784,
198,
2,
4100,
1222,
7020,
1220,
14784,
14,
4774,
... | 1.957447 | 611 |
# -*- coding: utf-8 -*-
"""
src.api.stats
~~~~~~~~~~~~~
Functions:
count_users()
"""
from src.api import Blueprint
from src.models.hacker import Hacker
stats_blueprint = Blueprint("stats", __name__)
# @stats_blueprint.route("/stats/user_count/", methods=["GET"])
@stats_blueprint.get("/stats/u... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
12351,
13,
15042,
13,
34242,
198,
220,
220,
220,
220,
15116,
8728,
93,
628,
220,
220,
220,
40480,
25,
628,
220,
220,
220,
220,
220,
220,
2... | 1.802947 | 543 |
import numpy as np
d = np.loadtxt(munge(line) for line in open('d11.txt')).astype(np.int)
floor = d == 0.0
n = np.zeros_like(d)
while True:
neighbours = calculate_neighbours()
d_ = np.copy(d)
d_[neighbours >= 5] = 0
d_[neighbours == 0] = 1
d_[floor] = 0
if np.all(d == d_):
print('stabl... | [
11748,
299,
32152,
355,
45941,
198,
67,
796,
45941,
13,
2220,
14116,
7,
6199,
469,
7,
1370,
8,
329,
1627,
287,
1280,
10786,
67,
1157,
13,
14116,
11537,
737,
459,
2981,
7,
37659,
13,
600,
8,
198,
28300,
796,
288,
6624,
657,
13,
15,... | 1.994536 | 183 |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
1946,
12,
42334,
383,
9485,
6173,
37,
34152,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,... | 1.83675 | 6,781 |
# Copyright 2010-2015 Josh Kearney
#
# 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 agre... | [
2,
220,
220,
15069,
3050,
12,
4626,
8518,
43512,
1681,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
1184... | 2.368421 | 779 |
import requests
from bs4 import BeautifulSoup
from base64 import b64decode
import re
import sys
| [
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
2779,
2414,
1330,
275,
2414,
12501,
1098,
198,
11748,
302,
198,
11748,
25064,
628,
628,
628,
628,
198
] | 3.354839 | 31 |
from PEManager import *
from pefile import *
import operator
| [
198,
6738,
350,
3620,
272,
3536,
1330,
1635,
198,
6738,
613,
7753,
1330,
1635,
198,
11748,
10088,
628
] | 3.5 | 18 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from ds_min_binary_heap_attribute import MinBinaryHeapAttribute
def prim(w_graph_d):
"""Prim's algorithm for minimum spanning tree
in "undirected weighted" graph, G(V, E).
Time complexity for : ... | [
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,
6738,
288,
82,
62,
1084,
62,
39491,
62,
258,
499,
62,
42348,
1330,
1855,
33,
3219,... | 2.102215 | 587 |
import pygame
import random
import time
SNAKE_WIDTH = 10
BORDER = 3
PADDING = 0
HEADER = 30
BOARD_ROW = 20
BOARD_COL = 30
WINDOW_PADDING = 20
BIG_FONT = 25
SMALL_FONT = 15
SCORE_FONT = 20
FONT_TYPE = 'Ubuntu Mono'
SNAKE_SPEED = 4 # cell per second
FOOD_NUMBER = 1 # number of food generated at once
POISON_PROBABILITY =... | [
11748,
12972,
6057,
198,
11748,
4738,
198,
11748,
640,
198,
198,
50,
4535,
7336,
62,
54,
2389,
4221,
796,
838,
198,
33,
12532,
1137,
796,
513,
198,
47,
29266,
2751,
796,
657,
198,
37682,
1137,
796,
1542,
198,
8202,
9795,
62,
49,
391... | 2.259398 | 532 |
#!/usr/bin/env python
__doc__ = '''Set the unicodes of glyphs in a font based on an external csv file.
- csv format glyphname,unicode, [unicode2, [,unicode3]]'''
__url__ = 'http://github.com/silnrsi/pysilfont'
__copyright__ = 'Copyright (c) 2016 SIL International (http://www.sil.org)'
__license__ = 'Released under the ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
834,
15390,
834,
796,
705,
7061,
7248,
262,
28000,
4147,
286,
25874,
82,
287,
257,
10369,
1912,
319,
281,
7097,
269,
21370,
2393,
13,
198,
12,
269,
21370,
5794,
25874,
3672,
11,
46903,... | 2.617284 | 324 |
# -*- coding: utf-8 -*-
import json
import random
from fiqs.testing.gen_data import random_shop_id, random_timestamp
if __name__ == '__main__':
size = 500
gen_traffic_data(size)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
33918,
198,
11748,
4738,
198,
198,
6738,
277,
25011,
82,
13,
33407,
13,
5235,
62,
7890,
1330,
4738,
62,
24643,
62,
312,
11,
4738,
62,
16514,
27823,
628,
19... | 2.480519 | 77 |
import asyncio
import gc
import inspect
import io
import textwrap
import traceback
from contextlib import redirect_stdout
from collections import Counter
import discord
from discord.ext import commands
import psutil
import paths
from utils import utils
class Dev(commands.Cog):
"""Nope, not for you."""
@co... | [
11748,
30351,
952,
198,
11748,
308,
66,
198,
11748,
10104,
198,
11748,
33245,
198,
11748,
2420,
37150,
198,
11748,
12854,
1891,
198,
6738,
4732,
8019,
1330,
18941,
62,
19282,
448,
198,
6738,
17268,
1330,
15034,
198,
198,
11748,
36446,
198... | 2.128283 | 2,627 |
import requests
res = requests.get('https://api.github.com/users/cn007b')
print(res)
print(res.text)
| [
11748,
7007,
198,
198,
411,
796,
7007,
13,
1136,
10786,
5450,
1378,
15042,
13,
12567,
13,
785,
14,
18417,
14,
31522,
25816,
65,
11537,
198,
4798,
7,
411,
8,
198,
4798,
7,
411,
13,
5239,
8,
198
] | 2.756757 | 37 |
import click
from pick import pick
from tabulate import tabulate
from ..util import (pick_with_cancel, prompt_for_date, prompt_for_money,
format_money)
from .cards import select_card
from .reward_types import select_reward_type_id
| [
11748,
3904,
198,
6738,
2298,
1330,
2298,
198,
6738,
7400,
5039,
1330,
7400,
5039,
198,
198,
6738,
11485,
22602,
1330,
357,
27729,
62,
4480,
62,
66,
21130,
11,
6152,
62,
1640,
62,
4475,
11,
6152,
62,
1640,
62,
26316,
11,
198,
220,
2... | 2.831461 | 89 |
import orm
from models import User
import asyncio
@asyncio.coroutine
loop = asyncio.get_event_loop()
loop.run_until_complete(test())
loop.close()
| [
11748,
393,
76,
198,
6738,
4981,
1330,
11787,
198,
11748,
30351,
952,
628,
198,
31,
292,
13361,
952,
13,
10215,
28399,
628,
198,
26268,
796,
30351,
952,
13,
1136,
62,
15596,
62,
26268,
3419,
198,
26268,
13,
5143,
62,
28446,
62,
20751,... | 2.941176 | 51 |
# Copyright (c) 2014, Salesforce.com, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions... | [
2,
15069,
357,
66,
8,
1946,
11,
17329,
3174,
13,
785,
11,
3457,
13,
220,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
17613,
11,
389,
10431,
2810,
326... | 2.599454 | 2,564 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016, Giacomo Cariello. 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
#
# Un... | [
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
66,
8,
1584,
11,
8118,
330,
17902,
1879,
494,
18798,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,... | 2.687143 | 700 |
import flee.flee as flee
import datamanager.handle_refugee_data as handle_refugee_data
import numpy as np
import outputanalysis.analysis as a
"""
Generation 1 code. Incorporates only distance, travel always takes one day.
"""
if __name__ == "__main__":
print("Testing basic data handling and simulation kernel.")
... | [
11748,
11562,
13,
69,
7197,
355,
11562,
198,
11748,
4818,
10546,
3536,
13,
28144,
62,
5420,
2217,
68,
62,
7890,
355,
5412,
62,
5420,
2217,
68,
62,
7890,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
5072,
20930,
13,
20930,
355,
257,... | 2.561983 | 484 |
import numpy as np
import gzip
from plyfile import PlyData
| [
11748,
299,
32152,
355,
45941,
198,
11748,
308,
13344,
198,
6738,
35960,
7753,
1330,
36526,
6601,
628,
628,
628
] | 3.368421 | 19 |
#!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""Match email addresses
"""
#end_pymotw_header
import re
address = re.compile('[\w\d.+-]+@([\w\d.]+\.)+(com|org|edu)')
candidates = [
u'first.last@example.com',
u'first.last+category@gmail.com',
u'vali... | [
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,
23850,
3053,
9405,
198,
37811,
... | 2.404444 | 225 |
import os.path
import pytest
INPUT_TXT = os.path.join(os.path.dirname(__file__), 'input.txt')
INPUT_S = '''\
v...>>.vv>
.vv>>.vv..
>>.>v>...v
>>v>>.>.v.
v>v.vv.v..
>.>>..v...
.vv..>.>v.
v.v..>>v.v
....v..v.>
'''
EXPECTED = 58
@pytest.mark.parametrize(
('input_s', 'expected'),
(
(INPUT_S, EXPECTED... | [
11748,
28686,
13,
6978,
198,
198,
11748,
12972,
9288,
198,
198,
1268,
30076,
62,
51,
25010,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
705,
15414,
13,
14116,
11537,
628,
198,
198,
126... | 1.888889 | 207 |
# -*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
import os
from .utils import lazy_property
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
198,
6738,
764,
26791,
1330,
16931,
62,
26745,
198,
220,
220,
220,
... | 2.6 | 45 |
from datetime import datetime, timedelta, time
import calendar
import csv
import re
import argparse
rest = []
find_lunch = argparse.ArgumentParser(description='Generate a list of open restaurants')
group = find_lunch.add_mutually_exclusive_group(required=True)
group.add_argument('-d', '--day', help='day restaurants ar... | [
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
11,
640,
198,
11748,
11845,
198,
11748,
269,
21370,
198,
11748,
302,
198,
11748,
1822,
29572,
198,
198,
2118,
796,
17635,
198,
19796,
62,
75,
3316,
796,
1822,
29572,
13,
28100,
1713,... | 3.059091 | 220 |
import inspect
import json
import pytest
from ..manifest import Manifest
from ..item import TestharnessTest, RefTest, item_types
@pytest.mark.parametrize("path", [
"a.https.c",
"a.b.https.c",
"a.https.b.c",
"a.b.https.c.d",
"a.serviceworker.c",
"a.b.serviceworker.c",
"a.serviceworker.b.c... | [
11748,
10104,
198,
11748,
33918,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
11485,
805,
8409,
1330,
36757,
198,
6738,
11485,
9186,
1330,
6208,
9869,
1108,
14402,
11,
6524,
14402,
11,
2378,
62,
19199,
628,
198,
31,
9078,
9288,
13,
410... | 1.959044 | 586 |
n, m = map(int, input().split())
rev_d = [{} for i in range(n + 1)]
g = [[] for i in range(n + 1)]
for e in range(m):
u, v = map(int, input().split())
if u not in rev_d[v]: rev_d[u] = 0
rev_d[u] += 1
g[v].append(v)
pairs = {}
for i in range(1, n + 1):
for j in g[i]:
| [
77,
11,
285,
796,
3975,
7,
600,
11,
5128,
22446,
35312,
28955,
198,
198,
18218,
62,
67,
796,
685,
90,
92,
329,
1312,
287,
2837,
7,
77,
1343,
352,
15437,
198,
70,
796,
16410,
60,
329,
1312,
287,
2837,
7,
77,
1343,
352,
15437,
198... | 2.042553 | 141 |
#! /usr/bin/env python
# coding=utf-8
# /************************************************************************************
# ***
# *** File Author: Dell, 2018年 09月 21日 星期五 10:25:44 CST
# ***
# ************************************************************************************/
import os
import argparse
impor... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
28,
40477,
12,
23,
198,
198,
2,
1220,
17174,
17174,
8412,
2466,
198,
2,
17202,
198,
2,
17202,
220,
220,
220,
9220,
6434,
25,
23617,
11,
2864,
33176,
112,
7769,
17312,
2... | 2.631902 | 652 |
import urllib
import random
import time
import pyperclip
filename = False
lineRn = 0 # For ordered mode
randomVal = 0
copyTime = False
# Gets lines, picks 10 random lines from the script
getFile()
randomOrOrdered()
# Open the file and read lines
with open(filename, 'r') as infile:
# Read ... | [
11748,
2956,
297,
571,
201,
198,
11748,
4738,
201,
198,
11748,
640,
201,
198,
11748,
12972,
525,
15036,
201,
198,
34345,
796,
10352,
201,
198,
1370,
49,
77,
796,
657,
1303,
1114,
6149,
4235,
201,
198,
25120,
7762,
796,
657,
201,
198,
... | 2.671233 | 219 |
from core.modules.vistrails_module import Module, ModuleError
from Matrix import *
from Array import *
import scipy
from scipy import io, sparse
class MatlabReader(ArrayUtilityModule, Module):
""" Read a Matlab .mat file into a SciPy matrix """
# Gather inputs here
# Set required members externally. Thi... | [
6738,
4755,
13,
18170,
13,
85,
396,
430,
4487,
62,
21412,
1330,
19937,
11,
19937,
12331,
198,
6738,
24936,
1330,
1635,
198,
6738,
15690,
1330,
1635,
198,
11748,
629,
541,
88,
198,
6738,
629,
541,
88,
1330,
33245,
11,
29877,
628,
198,
... | 3.190909 | 220 |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2020 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""`reana-dev`'s release commands."""
import os
import sys
import tempfile
from shutil import... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
4526,
31574,
13,
198,
2,
15069,
357,
34,
8,
12131,
327,
28778,
13,
198,
2,
198,
2,
4526,
31574,
318,
1479,
3788,
26,
345,
460,... | 2.29772 | 3,903 |
from .simulated_portfolio import SimulatedPortfolio
from .interactive_brokers_portfolio import InteractiveBrokersPortfolio
| [
6738,
764,
14323,
4817,
62,
634,
13652,
1330,
3184,
4817,
13924,
13652,
198,
6738,
764,
3849,
5275,
62,
7957,
15949,
62,
634,
13652,
1330,
21365,
15783,
15949,
13924,
13652,
198
] | 4.1 | 30 |
import os
from setuptools import setup
from health_check import __version__
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
setup(
name = ... | [
11748,
28686,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
6738,
1535,
62,
9122,
1330,
11593,
9641,
834,
198,
198,
2,
34030,
2163,
284,
1100,
262,
20832,
11682,
2393,
13,
198,
2,
16718,
329,
262,
890,
62,
11213,
13,
220,
632,
338,
... | 2.858974 | 390 |
"""Remove old `data source` attributes from the monolith page table
Revision ID: 2018_11_19_clean_page_sources
Revises: ban_dimension_timestamp_nulls
Create Date: 2018-11-20 12:08:43.201032
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by A... | [
37811,
27914,
1468,
4600,
7890,
2723,
63,
12608,
422,
262,
937,
21446,
2443,
3084,
198,
198,
18009,
1166,
4522,
25,
2864,
62,
1157,
62,
1129,
62,
27773,
62,
7700,
62,
82,
2203,
198,
18009,
2696,
25,
3958,
62,
46156,
62,
16514,
27823,
... | 2.163897 | 3,490 |
print('='*20, 'DESAFIO 013', '='*20) #ok
print('Vamos calcular qual serio o valor do seu salário se o atual sofresse um aumento de 15%?')
sa = int(input('Digite valor do seu salário atual: '))
sal_acresc = sa * 1.15
print(f'O valor do seu salário com o acréscimo de 15% é de R$ {sal_acresc:.2f}') | [
4798,
10786,
11639,
9,
1238,
11,
705,
30910,
8579,
9399,
5534,
18,
3256,
705,
11639,
9,
1238,
8,
1303,
482,
201,
198,
201,
198,
4798,
10786,
53,
321,
418,
2386,
10440,
4140,
1055,
952,
267,
1188,
273,
466,
384,
84,
3664,
6557,
27250... | 2.169014 | 142 |
# coding: utf-8
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 :
import datetime
import uuid
import json
from app.core.db import db
entity_schema = {
"type": "object",
"properties": {
"entity_type_id": {"type": "string"},
"content": {"type": "object"},
},
"required": [ "entity_t... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
43907,
25,
900,
2393,
12685,
7656,
28,
40477,
12,
23,
1058,
198,
198,
11748,
4818,
8079,
198,
11748,
334,
27112,
198,
11748,
... | 2.175637 | 353 |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_session import Session
import logging
from logging.handlers import RotatingFileHandler
from config import config,Config
from redis import StrictRedis
from flask_wtf import CSRFProtect,csrf
db = SQLAlchemy()
redis_store = StrictRedis(host=Confi... | [
6738,
42903,
1330,
46947,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
42903,
62,
29891,
1330,
23575,
198,
11748,
18931,
198,
6738,
18931,
13,
4993,
8116,
1330,
18481,
803,
8979,
25060,
198,
6738,
4566,
13... | 1.642722 | 529 |
from django.urls import include, path
from django.views.generic import RedirectView
from boundlexx.api.common import views
from boundlexx.api.v1.router import router as apiv1
from boundlexx.api.v2.router import router as apiv2
# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for th... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
2291,
11,
3108,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
2297,
1060,
7680,
198,
198,
6738,
5421,
2588,
87,
13,
15042,
13,
11321,
1330,
5009,
198,
6738,
5421,
2588,
87,
13,
15042,
13,... | 2.626959 | 319 |
#!/usr/bin/env python
from datafile import Datafile, DatafileError
import argparse
if __name__ == '__main__':
p = argparse.ArgumentParser()
p.add_argument('filenames', metavar='datafile', type=str, nargs='+', help='the datafiles to be processed')
args = p.parse_args()
for filename in args.filenames:
do(filenam... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
1366,
7753,
1330,
6060,
7753,
11,
6060,
7753,
12331,
198,
198,
11748,
1822,
29572,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
197,
79,
796,
1822,
29... | 2.858407 | 113 |
from setuptools import setup
setup(name='flickr_download',
version='0.2.21',
description='Download photos from Flickr',
long_description=readme(),
url='https://github.com/beaufour/flickr-download.git',
author='Allan Beaufour, Marian Such',
author_email='allan@beaufour.dk, toxygen1... | [
6738,
900,
37623,
10141,
1330,
9058,
628,
198,
198,
40406,
7,
3672,
11639,
2704,
18994,
62,
15002,
3256,
198,
220,
220,
220,
220,
220,
2196,
11639,
15,
13,
17,
13,
2481,
3256,
198,
220,
220,
220,
220,
220,
6764,
11639,
10002,
5205,
... | 2.099462 | 372 |
import logging
import auxiliary_module
# create logger with 'spam_application'
logger = logging.getLogger('spam_application')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
fh = logging.FileHandler('spam.log')
fh.setLevel(logging.DEBUG)
# create console handler with a higher log le... | [
11748,
18931,
198,
11748,
37419,
62,
21412,
198,
198,
2,
2251,
49706,
351,
705,
2777,
321,
62,
31438,
6,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
10786,
2777,
321,
62,
31438,
11537,
198,
6404,
1362,
13,
2617,
4971,
7,
6404,... | 3.190184 | 326 |
from threading import Thread, Timer, jsonify
import ecommerce.shipping
from ecommerce.shipping import calc_test
import json
TEST = 15
var_a = 1000
var_b = 'single'
var_c = "double"
var_d = True
var_e = None
var_f = """
Hello I am a
multiline string
"""
var_g = f'I am a {var_b.c} quoted template string'
var_h = f"I am ... | [
6738,
4704,
278,
1330,
14122,
11,
5045,
263,
11,
33918,
1958,
198,
11748,
304,
27061,
13,
1477,
4501,
198,
6738,
304,
27061,
13,
1477,
4501,
1330,
42302,
62,
9288,
198,
11748,
33918,
198,
198,
51,
6465,
796,
1315,
198,
7785,
62,
64,
... | 2.439655 | 812 |
# coding: utf-8
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
1... | 3.533333 | 375 |
from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
status = {}
F = {}
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
@app.get("/")
@app.post("/servo")
@app.post(... | [
6738,
3049,
15042,
1330,
12549,
17614,
11,
19390,
198,
6738,
3049,
15042,
13,
27171,
1574,
13,
66,
669,
1330,
23929,
12310,
2509,
1574,
198,
1324,
796,
12549,
17614,
3419,
198,
198,
13376,
796,
23884,
198,
37,
796,
23884,
198,
198,
1324... | 2.357616 | 151 |
from datetime import timedelta
import graphene
from flask import abort
from flask_jwt_extended import create_access_token, get_current_user, jwt_required
from app.core.security import verify_password
from app.core import config
from app.gql_api.base import BaseMutation, default_model_resolver
from app.models.user imp... | [
6738,
4818,
8079,
1330,
28805,
12514,
198,
198,
11748,
42463,
198,
6738,
42903,
1330,
15614,
198,
6738,
42903,
62,
73,
46569,
62,
2302,
1631,
1330,
2251,
62,
15526,
62,
30001,
11,
651,
62,
14421,
62,
7220,
11,
474,
46569,
62,
35827,
1... | 3.491667 | 120 |
# SPDX-License-Identifier: Apache-2.0
"""
Tests for the utility commands
"""
import unittest
import logging
import tempfile
import os
from click.testing import CliRunner
from aswfdocker import utils, constants
from aswfdocker.cli import aswfdocker
| [
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
37811,
198,
51,
3558,
329,
262,
10361,
9729,
198,
37811,
198,
198,
11748,
555,
715,
395,
198,
11748,
18931,
198,
11748,
20218,
7753,
198,
11748,
28686,
198,
1... | 3.24359 | 78 |
# -*- coding: utf-8 -*-
import os
import time
import unittest
from datetime import date
from datetime import datetime
from pathlib import Path
import pytest
from dsg_lib.folder_functions import get_directory_list
from dsg_lib.folder_functions import last_data_files_changed
from dsg_lib.folder_functions import make_fo... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
640,
198,
11748,
555,
715,
395,
198,
6738,
4818,
8079,
1330,
3128,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
3108,
8019,
1330,
10644,
... | 3.28777 | 139 |
# This should be an enum once we make our own buildkite AMI with py3
SupportedPythons = [
SupportedPython.V2_7,
SupportedPython.V3_5,
SupportedPython.V3_6,
SupportedPython.V3_7,
SupportedPython.V3_8,
]
# See: https://github.com/dagster-io/dagster/issues/1960
SupportedPythonsNo38 = [
Supported... | [
2,
770,
815,
307,
281,
33829,
1752,
356,
787,
674,
898,
1382,
74,
578,
3001,
40,
351,
12972,
18,
628,
198,
48181,
47,
5272,
684,
796,
685,
198,
220,
220,
220,
36848,
37906,
13,
53,
17,
62,
22,
11,
198,
220,
220,
220,
36848,
3790... | 2.322751 | 378 |