content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from src.blockchain.block import Transaction
from src.blockchain.blockchain import Blockchain
transactions = [Transaction("Justus", "Jonas", 10.0),
Transaction("Bernd", "Harald", 5.0)]
blockchain = Blockchain()
blockchain.add_block(transactions) | [
6738,
12351,
13,
9967,
7983,
13,
9967,
1330,
45389,
201,
198,
6738,
12351,
13,
9967,
7983,
13,
9967,
7983,
1330,
29724,
201,
198,
201,
198,
7645,
4658,
796,
685,
48720,
7203,
5703,
385,
1600,
366,
18219,
292,
1600,
838,
13,
15,
828,
... | 2.945055 | 91 |
from pykafka import KafkaClient
import json
from datetime import datetime
import uuid
import time
input_file = open('./data/bus2.json')
json_array = json.load(input_file)
coordinates = json_array['features'][0]['geometry']['coordinates']
# Generate uuid
# Kafaka producer
client = KafkaClient(hosts="localhost:9092... | [
6738,
12972,
74,
1878,
4914,
1330,
46906,
11792,
198,
11748,
33918,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
334,
27112,
198,
11748,
640,
628,
198,
15414,
62,
7753,
796,
1280,
7,
4458,
14,
7890,
14,
10885,
17,
13,
17752,
1... | 3.113208 | 159 |
from classes.DatabaseConnection import DatabaseConnection | [
6738,
6097,
13,
38105,
32048,
1330,
24047,
32048
] | 7.125 | 8 |
from datetime import datetime
from taegis_sdk_python import ServiceCore
from taegis_sdk_python.services.investigations.mutations import InvestigationMutation
from taegis_sdk_python.services.investigations.queries import InvestigationQuery
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
20486,
1533,
271,
62,
21282,
74,
62,
29412,
1330,
4809,
14055,
198,
6738,
20486,
1533,
271,
62,
21282,
74,
62,
29412,
13,
30416,
13,
24859,
328,
602,
13,
21973,
602,
1330,
21505,
44,... | 3.651515 | 66 |
from time import time
from math import factorial
from logging import getLogger
from collections import deque
from itertools import permutations, repeat
from random import sample, randint
from typing import List, Optional, Callable
from networkx import DiGraph
from numpy.random import choice
import numpy as np
# Local... | [
6738,
640,
1330,
640,
198,
6738,
10688,
1330,
1109,
5132,
198,
6738,
18931,
1330,
651,
11187,
1362,
198,
6738,
17268,
1330,
390,
4188,
198,
6738,
340,
861,
10141,
1330,
9943,
32855,
11,
9585,
198,
6738,
4738,
1330,
6291,
11,
43720,
600,... | 2.300709 | 2,115 |
#!/usr/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/dash/")
from dash import app as application
application.secret_key = 'Add your secret key'
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
25064,
198,
11748,
18931,
198,
6404,
2667,
13,
35487,
16934,
7,
5532,
28,
17597,
13,
301,
1082,
81,
8,
198,
17597,
13,
6978,
13,
28463,
7,
15,
553,
14,
7785,
14,
2503,
14,
42460,
1... | 3.029851 | 67 |
# This an autogenerated file
#
# Generated with ISO19901_7Filter
from typing import Dict,Sequence,List
from dmt.entity import Entity
from dmt.blueprint import Blueprint
from .blueprints.iso19901_7filter import ISO19901_7FilterBlueprint
from typing import Dict
from sima.post.consequenceclass import ConsequenceClass
fro... | [
2,
770,
281,
1960,
519,
877,
515,
2393,
198,
2,
220,
198,
2,
2980,
515,
351,
19694,
19104,
486,
62,
22,
22417,
198,
6738,
19720,
1330,
360,
713,
11,
44015,
594,
11,
8053,
198,
6738,
288,
16762,
13,
26858,
1330,
20885,
198,
6738,
2... | 2.472856 | 2,542 |
#! /usr/bin/env python3
import argparse
import logging
import dotenv
import dl_hathi
import dl_ia
if __name__ == "__main__":
main()
| [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
16605,
24330,
198,
198,
11748,
288,
75,
62,
71,
44202,
198,
11748,
288,
75,
62,
544,
628,
628,
198,
198,
361,
11593,
367... | 2.508772 | 57 |
#############################################################################
##
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the Qt for Python examples of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:BSD$
## You may use this file under the terms of the BSD li... | [
198,
29113,
29113,
7804,
4242,
2,
198,
2235,
198,
2235,
15069,
357,
34,
8,
1584,
383,
33734,
5834,
12052,
13,
198,
2235,
14039,
25,
2638,
1378,
2503,
13,
39568,
13,
952,
14,
677,
26426,
14,
198,
2235,
198,
2235,
770,
2393,
318,
636,... | 3.485669 | 628 |
from .aco import AntColonyOptimization
from .ga import GeneticAlgorithm
from .lp import LinearIntegerProgram
from .pso import ParticleSwarmOptimization
from .sa import SimulatedAnnealing
from .two_opt import TwoOpt
| [
6738,
764,
10602,
1330,
3738,
5216,
1647,
27871,
320,
1634,
198,
6738,
764,
4908,
1330,
42295,
2348,
42289,
198,
6738,
764,
34431,
1330,
44800,
46541,
15167,
198,
6738,
764,
79,
568,
1330,
2142,
1548,
10462,
1670,
27871,
320,
1634,
198,
... | 3.706897 | 58 |
import math
import sys
import time
import torch
from ..utils import utils
from ..utils.metric_logger import MetricLogger, SmoothedValue
@torch.no_grad()
import numpy as np
def get_model_scores(pred_boxes):
"""Creates a dictionary of from model_scores to image ids.
Args:
pred_boxes (dict): dict ... | [
11748,
10688,
198,
11748,
25064,
198,
11748,
640,
198,
198,
11748,
28034,
198,
198,
6738,
11485,
26791,
1330,
3384,
4487,
198,
6738,
11485,
26791,
13,
4164,
1173,
62,
6404,
1362,
1330,
3395,
1173,
11187,
1362,
11,
2439,
1025,
704,
11395,
... | 2.022392 | 1,831 |
from springpython.context import *
from springpython.config import *
from pika_client import *
from amqplib_client import *
from ticker_system import *
from buy_low_sell_high import *
| [
6738,
6076,
29412,
13,
22866,
1330,
1635,
198,
6738,
6076,
29412,
13,
11250,
1330,
1635,
198,
198,
6738,
279,
9232,
62,
16366,
1330,
1635,
198,
6738,
716,
80,
489,
571,
62,
16366,
1330,
1635,
198,
6738,
4378,
263,
62,
10057,
1330,
163... | 3.425926 | 54 |
from colors import *
from utils import font_height
| [
6738,
7577,
1330,
1635,
198,
6738,
3384,
4487,
1330,
10369,
62,
17015,
198
] | 3.923077 | 13 |
#!/usr/bin/env python
# coding: utf-8
# In[51]:
# Generic Libraries
from PIL import Image
from keras.preprocessing.text import Tokenizer
import os
import pandas as pd
import numpy as np
import re,string,unicodedata
import cv2
import requests
import csv
import pickle
#Tesseract Library
import pytesseract
pytesserac... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
4349,
5974,
628,
198,
2,
42044,
46267,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
41927,
292,
13,
3866,
36948,
13,
5239,
133... | 2.316936 | 1,423 |
import os
import sys
import unittest
from contextlib import contextmanager
from functools import partial
from pathlib import Path
from typing import Any, Iterator, List, Optional, Tuple
import black
from black.debug import DebugVisitor
from black.mode import TargetVersion
from black.output import diff, err, out
THIS_... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
555,
715,
395,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
4377,
11,
40806,
1352,
11,
7343,
... | 2.932356 | 887 |
# Copyright (c) 2018 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# htt... | [
2,
15069,
357,
66,
8,
2864,
33086,
371,
1921,
357,
4023,
1378,
2503,
13,
271,
1050,
292,
13,
622,
8,
198,
2,
16975,
1236,
1134,
709,
5136,
329,
4482,
30297,
286,
262,
3394,
8581,
286,
13473,
198,
2,
198,
2,
49962,
739,
262,
24843,... | 3.594796 | 269 |
import numpy as np
import tensorflow as tf
_VGG_MEAN = [103.939, 116.779, 123.68]
class Vgg19:
"""
The network configuration:
- RGB 224x224x3
- conv3-64
- conv3-64
- maxpool
- (112x112x128)
- conv3-128
- conv3-128
- maxpool
- (56x56x256)
- conv3-256
- conv3-256
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
62,
53,
11190,
62,
11682,
1565,
796,
685,
15197,
13,
24,
2670,
11,
18693,
13,
40393,
11,
17031,
13,
3104,
60,
198,
198,
4871,
569,
1130,
1129,
25,
1... | 1.956081 | 888 |
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.views.generic import TemplateView
from jsonrpc import jsonrpc_site
import dd_auth.views
# Uncomment the next line for overwriting templates
#from django.views.generic.simple import direct_to_template
# Uncomment the nex... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
2291,
11,
19016,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
37350,
7680,
628,
198,
6738,
33918,
81,
14751,
1330,
3391... | 2.639946 | 736 |
# Generated by Django 2.1.1 on 2018-10-05 00:59
from django.db import migrations, models
import django.utils.timezone
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
16,
319,
2864,
12,
940,
12,
2713,
3571,
25,
3270,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
26791,
13,
2435,
11340,
628
] | 2.926829 | 41 |
import os
import requests
import colorific
from PIL import Image
from . import Validador
STEAM_OWNERS_MIN = int(os.environ['STEAM_OWNERS_MIN'])
STEAM_GAMES_LIMIT = int(os.environ['STEAM_GAMES_LIMIT'])
| [
11748,
28686,
198,
11748,
7007,
198,
11748,
3124,
811,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
764,
1330,
48951,
7079,
198,
198,
30516,
2390,
62,
14165,
4877,
62,
23678,
796,
493,
7,
418,
13,
268,
2268,
17816,
30516,
2390,
62,
14... | 2.636364 | 77 |
#!/usr/bin/python
import Board
import os
import time
import sys
from Loader import glider_gun
dimension = 15
if len(sys.argv) > 1:
dimension = int(sys.argv[1])
foo = Board.Board(dimension)
# for key, cell in foo.board.iteritems():
# cell.state = False
# for i in range(len(glider_gun)):
# for j in range... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
5926,
198,
11748,
28686,
198,
11748,
640,
198,
11748,
25064,
198,
6738,
8778,
263,
1330,
1278,
1304,
62,
7145,
628,
198,
198,
46156,
796,
1315,
198,
361,
18896,
7,
17597,
13,
853,... | 2.157197 | 528 |
import linecache
path = '/home/nevronas/Projects/Personal-Projects/Dhruv/OffensEval/dataset/train-v1/offenseval-training-v1.tsv'
maxi = 0
with open(path, "r") as f:
for line in f:
contents = line.split("\t")
l = len(contents[1].split(" ")[1:])
print(l)
if(l > maxi):
maxi... | [
11748,
1627,
23870,
198,
6978,
796,
31051,
11195,
14,
710,
85,
1313,
292,
14,
16775,
82,
14,
30228,
12,
16775,
82,
14,
35,
71,
622,
85,
14,
9362,
641,
36,
2100,
14,
19608,
292,
316,
14,
27432,
12,
85,
16,
14,
2364,
1072,
2100,
1... | 1.965517 | 174 |
from tokens import Token
| [
6738,
16326,
1330,
29130,
628,
628
] | 4.666667 | 6 |
"""This script disovers and tests OpenCV bioinspired module's API.
Author: Yuhuang Hu
Email : yuhuang.hu@uzh.ch
"""
import cv2
from moviepy.video.io.ffmpeg_reader import FFMPEG_VideoReader
from simretina import dataset, gui, retina
option = "test-movie-py"
if option == "test-builtin-image":
# testing for built... | [
37811,
1212,
4226,
595,
13801,
290,
5254,
4946,
33538,
13401,
24194,
8265,
338,
7824,
13,
198,
198,
13838,
25,
575,
7456,
84,
648,
11256,
198,
15333,
1058,
331,
7456,
84,
648,
13,
13415,
31,
10277,
71,
13,
354,
198,
37811,
198,
198,
... | 2.437048 | 691 |
import logging
import os
from logging.handlers import SMTPHandler, RotatingFileHandler
from flask import Flask, g
from flask_security import Security, SQLAlchemyUserDatastore
from flask_sqlalchemy import SQLAlchemy
from turbo_flask import Turbo
from config import Config
__all__ = [
'app',
'db',
'turbo'... | [
198,
11748,
18931,
198,
11748,
28686,
198,
6738,
18931,
13,
4993,
8116,
1330,
9447,
7250,
25060,
11,
18481,
803,
8979,
25060,
198,
198,
6738,
42903,
1330,
46947,
11,
308,
198,
6738,
42903,
62,
12961,
1330,
4765,
11,
16363,
2348,
26599,
... | 2.547445 | 959 |
#!/usr/bin/env python
"""
A GTK quick message popup program.
Allows users to quickly share messages with others on their own screen. Useful
for when you need to be silent but want to communicate with the person sitting
next to you, e.g. for games of hangman during lectures.
TODO: allow multi-lines
"""
__author__ = ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
32,
7963,
42,
2068,
3275,
46207,
1430,
13,
198,
198,
34934,
2985,
284,
2952,
2648,
6218,
351,
1854,
319,
511,
898,
3159,
13,
49511,
198,
1640,
618,
345,
761,
284,
30... | 2.167529 | 1,546 |
# coding=utf-8
# !/usr/bin/env python
import sys
try:
from setuptools import setup
except ImportError:
sys.stderr.write('using distutils\n')
from distutils.core import setup
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
name='amber-python-drivers',
packages=[
... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
5145,
14,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
25064,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
900,
37623,
10141,
1330,
9058,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
2506... | 2.239531 | 1,194 |
# USAGE
# python superpixel.py --image cactus.jpg
import torch
import matplotlib.pyplot as plt
from skimage import io
from skimage.segmentation import quickshift, mark_boundaries # 导入mark_boundaries 以绘制实际的超像素分割
# 导入必要的包
from skimage.segmentation import slic # 导入包以使用SLIC superpixel segmentation
from skimage.util imp... | [
2,
220,
1294,
11879,
198,
2,
220,
21015,
2208,
32515,
13,
9078,
1377,
9060,
269,
34144,
13,
9479,
198,
11748,
28034,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
1341,
9060,
1330,
33245,
198,
6738,
1341,
90... | 1.543645 | 653 |
import requests_cache
USER_AGENT = "ask_the_duck v0.0.1"
SESSION = requests_cache.CachedSession(expire_after=5 * 60, backend="memory")
SESSION.headers = {"User-Agent": USER_AGENT} | [
11748,
7007,
62,
23870,
198,
29904,
62,
4760,
3525,
796,
366,
2093,
62,
1169,
62,
646,
694,
410,
15,
13,
15,
13,
16,
1,
198,
50,
47621,
796,
7007,
62,
23870,
13,
34,
2317,
36044,
7,
1069,
5111,
62,
8499,
28,
20,
1635,
3126,
11,
... | 2.712121 | 66 |
from sklearn import preprocessing, metrics
import lightgbm as lgb
import pandas as pd
import numpy as np
from sklearn.model_selection import StratifiedKFold, KFold, RepeatedKFold, GroupKFold, GridSearchCV, train_test_split, TimeSeriesSplit
from datetime import datetime
import copy
import os
import fire
import glob
impo... | [
6738,
1341,
35720,
1330,
662,
36948,
11,
20731,
198,
11748,
1657,
70,
20475,
355,
300,
22296,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
29186,
1431,
42,... | 2.269457 | 3,058 |
# coding: utf-8
# pylint: disable= too-many-lines, redefined-builtin, protected-access
"""NDArray API of mxnet."""
from __future__ import absolute_import
from __future__ import division
import ctypes
import warnings
import sys
import functools
import operator
import numpy as np
from .base import _LIB, string_types, nu... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
279,
2645,
600,
25,
15560,
28,
1165,
12,
21834,
12,
6615,
11,
2266,
18156,
12,
18780,
259,
11,
6861,
12,
15526,
198,
37811,
8575,
19182,
7824,
286,
285,
87,
3262,
526,
15931,
198,
6738,
1159... | 2.171309 | 17,915 |
from flask import request
from flask_babelex import gettext
from project import app, babel
@babel.localeselector
| [
6738,
42903,
1330,
2581,
198,
6738,
42903,
62,
65,
11231,
2588,
1330,
651,
5239,
198,
198,
6738,
1628,
1330,
598,
11,
9289,
417,
628,
198,
31,
65,
9608,
13,
17946,
2040,
9509,
273,
628
] | 3.441176 | 34 |
# Generated by Django 3.0.4 on 2020-05-05 17:56
import django.contrib.auth.validators
import django.core.validators
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
19,
319,
12131,
12,
2713,
12,
2713,
1596,
25,
3980,
198,
198,
11748,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
12102,
2024,
198,
11748,
42625,
14208,
13,
7295,
13,
12102,
2024,
198,
6738,... | 3 | 53 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Examples of how to use scripts in this directory
"""
from db_api import accident
accident1_id = 11
accident1 = accident.new(
id=accident1_id,
country='USA',
timestamp='TIMESTAMP \'2014-05-16 15:36:38\'',
day_of_week=7,
latitude=23.3453451,
longitu... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
27730,
286,
703,
284,
779,
14750,
287,
428,
8619,
198,
37811,
198,
198,
6738,
20613,
62,
15042,
1330,
5778,
... | 2.345622 | 217 |
#!/usr/bin/env python
# coding=utf8
PLUGIN_CLASS_GET_HANDLER = 'get_handler'
PLUGIN_CLASS_KEY_REGISTER = '__register__'
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
28,
40477,
23,
198,
198,
6489,
7340,
1268,
62,
31631,
62,
18851,
62,
39,
6981,
39878,
796,
705,
1136,
62,
30281,
6,
198,
6489,
7340,
1268,
62,
31631,
62,
20373,
62,
31553,
... | 2.372549 | 51 |
import torch
from datetime import datetime
| [
11748,
28034,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198
] | 4.3 | 10 |
"""
fanout模式下,传递到 exchange 的消息将会转发到所有与其绑定的 queue 上。
不需要指定 routing_key ,即使指定了也是无效。
需要提前将 exchange 和 queue 绑定,一个 exchange 可以绑定多个 queue,一个queue可以绑定多个exchange。
需要先启动 订阅者,此模式下的队列是 consumer 随机生成的,发布者 仅仅发布消息到 exchange ,由 exchange 转发消息至 queue。
"""
import json
import pika
if __name__ == '__main__':
credentials = pika... | [
37811,
198,
24408,
448,
162,
101,
94,
28156,
237,
10310,
233,
171,
120,
234,
27670,
254,
34460,
240,
26344,
108,
5163,
13328,
248,
226,
162,
114,
230,
162,
223,
107,
49546,
27670,
248,
164,
121,
105,
20998,
239,
26344,
108,
33699,
222... | 1.432591 | 853 |
import pytest
from pydicom.dataset import FileDataset, FileMetaDataset
@pytest.fixture(scope='function')
| [
11748,
12972,
9288,
198,
198,
6738,
279,
5173,
291,
296,
13,
19608,
292,
316,
1330,
9220,
27354,
292,
316,
11,
9220,
48526,
27354,
292,
316,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
29982,
11639,
8818,
11537,
198
] | 2.769231 | 39 |
from CHECLabPy.plotting.camera import CameraImage
import numpy as np
from matplotlib import pyplot as plt
ci = CameraImageClick.from_camera_version("1.1.0")
plt.show()
np.save("click_camera.npy", ci.image)
| [
6738,
5870,
2943,
17822,
20519,
13,
29487,
889,
13,
25695,
1330,
20432,
5159,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
628,
198,
198,
979,
796,
20432,
5159,
8164,
13,
6738,
62,
... | 2.786667 | 75 |
#!/usr/bin/env python3
"""
Gaussian mixture fitting with Nested Sampling. This module was tested in the
main `nestfit` repo on bare arrays and Gaussian components -- without a
spectral axis, units, or other necessary complications.
The `.wrapped` references a Cython implementation of the Gaussian model class.
"""
imp... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
35389,
31562,
11710,
15830,
351,
399,
7287,
3409,
11347,
13,
770,
8265,
373,
6789,
287,
262,
198,
12417,
4600,
77,
395,
11147,
63,
29924,
319,
6247,
26515,
290,
12822,
... | 3.016667 | 300 |
# ROS packages required
from eagerx import Object, Engine, Node, initialize, log, process
initialize("eagerx_core", anonymous=True, log_level=log.INFO)
# Environment
from eagerx.core.env import EagerxEnv
from eagerx.core.graph import Graph
from eagerx.wrappers import Flatten
# Implementation specific
import eagerx.n... | [
2,
48263,
10392,
2672,
198,
6738,
11069,
87,
1330,
9515,
11,
7117,
11,
19081,
11,
41216,
11,
2604,
11,
1429,
198,
198,
36733,
1096,
7203,
68,
3536,
87,
62,
7295,
1600,
11614,
28,
17821,
11,
2604,
62,
5715,
28,
6404,
13,
10778,
8,
... | 2.602594 | 848 |
from .dense import DenseNet | [
6738,
764,
67,
1072,
1330,
360,
1072,
7934
] | 3.375 | 8 |
from networkx.utils.misc import *
from networkx.utils.decorators import *
from networkx.utils.random_sequence import *
from networkx.utils.union_find import *
from networkx.utils.rcm import *
from networkx.utils.heaps import *
| [
6738,
3127,
87,
13,
26791,
13,
44374,
1330,
1635,
198,
6738,
3127,
87,
13,
26791,
13,
12501,
273,
2024,
1330,
1635,
198,
6738,
3127,
87,
13,
26791,
13,
25120,
62,
43167,
1330,
1635,
198,
6738,
3127,
87,
13,
26791,
13,
24592,
62,
197... | 3.338235 | 68 |
# Preprocess an input text:
# - delete punctuation symbols (commas, periods,
# exclamation and question marks ,.!?),
# - convert all symbols to lowercase.
# Then print your text.
# Punctuation marks appear not only at the end of the input
# string, so you have to figure out how to get rid of all of them.
pri... | [
2,
3771,
14681,
281,
5128,
2420,
25,
198,
198,
2,
220,
532,
12233,
21025,
2288,
14354,
357,
785,
5356,
11,
9574,
11,
198,
2,
220,
220,
220,
409,
20931,
290,
1808,
8849,
837,
13,
22857,
828,
198,
2,
220,
532,
10385,
477,
14354,
284... | 3.290323 | 124 |
import re
from typing import Optional
from flask import redirect, render_template, request, url_for
from koro.dataset import JsonLoader
from koro.manipulation import first_true
| [
11748,
302,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
42903,
1330,
18941,
11,
8543,
62,
28243,
11,
2581,
11,
19016,
62,
1640,
198,
198,
6738,
479,
16522,
13,
19608,
292,
316,
1330,
449,
1559,
17401,
198,
6738,
479,
16522,
13,
805... | 3.64 | 50 |
import mimeparse
from django.contrib.auth.models import AnonymousUser
from hyperadmin.states import State
class APIRequest(object):
"""
An API Request
"""
@property
@property
def get_response_type(self):
"""
Returns the active response type to be used
:rtype: stri... | [
11748,
285,
524,
29572,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
19200,
12982,
198,
198,
6738,
8718,
28482,
13,
27219,
1330,
1812,
628,
198,
4871,
7824,
18453,
7,
15252,
2599,
198,
220,
220,
220,
37227,
... | 2.482472 | 2,282 |
from grafo_adj_nao_dir import *
g8 = Grafo([], {})
for i in ['a', 'b', 'c', 'd', 'e', 'f', 'g']:
g8.adicionaVertice(i)
g8.adicionaAresta("a-b", 5)
g8.adicionaAresta("a-e", 12)
g8.adicionaAresta("b-g", 4)
g8.adicionaAresta("b-f", 9)
g8.adicionaAresta("c-d", 10)
g8.adicionaAresta("c-f", 7)
g8.adicionaAresta("d-f", 8)... | [
6738,
7933,
6513,
62,
41255,
62,
2616,
78,
62,
15908,
1330,
1635,
198,
70,
23,
796,
7037,
6513,
26933,
4357,
23884,
8,
198,
1640,
1312,
287,
37250,
64,
3256,
705,
65,
3256,
705,
66,
3256,
705,
67,
3256,
705,
68,
3256,
705,
69,
325... | 1.827004 | 237 |
#!/usr/bin/python
import socket
def tcpping(host, port, timeout = 5):
""" Does a TCP 'ping'
Simply attempts a socket connection on the specified port
22 = SSH
23 = Telnet
Timeout is 5 seconds
Code "borrowed" from yantisj
"""
try:
s = socket.socket(socket.AF_... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
17802,
198,
198,
4299,
37096,
2105,
7,
4774,
11,
2493,
11,
26827,
796,
642,
2599,
198,
220,
220,
220,
37227,
8314,
257,
23633,
705,
13886,
6,
198,
220,
220,
220,
220,
220,
220,
... | 2.182979 | 235 |
# Adapted for numpy/ma/cdms2 by convertcdms.py
import adamsregrid
import numpy
import EzTemplate
import vcs.test.support
bg = vcs.test.support.bg
ts=[]
M = EzTemplate.Multi(1,5)
for i in range(5):
ts.append(M.get())
## Prepare axes
lon1 = numpy.arange(0,360,.25,'f')/180.*numpy.pi #.25 deg
lat1 = numpy.arange(0,... | [
2,
30019,
276,
329,
299,
32152,
14,
2611,
14,
10210,
907,
17,
416,
10385,
10210,
907,
13,
9078,
198,
11748,
512,
4105,
260,
25928,
198,
11748,
299,
32152,
198,
11748,
21034,
30800,
198,
11748,
410,
6359,
13,
9288,
13,
11284,
198,
3590... | 1.82777 | 1,498 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from ... import _utilities
import typing
# Export this package's modules as members:
from ._enums import *
from .application import *
from .application... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
26144,
35986,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760,
644,
345,
389,
1804,
0,
17202,
... | 3.794521 | 146 |
import ftplib
from ftplib import FTP
from sys import argv
import warnings
import functions as F
from tqdm import tqdm
import os
warnings.filterwarnings('ignore')
not_to_download = [
"LIDC-IDRI-0001",
"LIDC-IDRI-0004",
"LIDC-IDRI-0007",
"LIDC-IDRI-0010",
"LIDC-IDRI-0013",
"LIDC-IDRI-0016",
... | [
11748,
10117,
489,
571,
198,
6738,
10117,
489,
571,
1330,
45854,
198,
6738,
25064,
1330,
1822,
85,
198,
11748,
14601,
198,
11748,
5499,
355,
376,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
28686,
198,
198,
40539,
654,
... | 2.106011 | 915 |
from django.shortcuts import render
from django.http import HttpResponseRedirect
from .models import Action
from .models import Sport
from .forms import ActionForm
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
7738,
1060,
198,
6738,
764,
27530,
1330,
7561,
198,
6738,
764,
27530,
1330,
12771,
198,
6738,
764,
23914,
1330,
7561,
8479,
628
... | 4.125 | 40 |
import os
from django.conf import settings
from django.shortcuts import render
def render_special_markdown_template(request, template_name, relative_path):
"""
:param request:
:param template_name:
:param relative_path: markdown relative path from BASE_DIR like 'docs/demos.md'
:return:
"""
... | [
11748,
28686,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
628,
628,
198,
4299,
8543,
62,
20887,
62,
4102,
2902,
62,
28243,
7,
25927,
11,
11055,
62,
3672,
11,
3585,
62,
69... | 2.647913 | 551 |
#!/usr/bin/env python
#
# Runs a Tornado web server with a django project
# Make sure to edit the DJANGO_SETTINGS_MODULE to point to your settings.py
#
# http://localhost:8080/hello-tornado
# http://localhost:8080
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
import os
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
44743,
257,
48970,
3992,
4382,
351,
257,
42625,
14208,
1628,
198,
2,
6889,
1654,
284,
4370,
262,
13004,
1565,
11230,
62,
28480,
51,
20754,
62,
33365,
24212,
284,
966,
284,
... | 3.220096 | 209 |
# -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
1303,
198,
2,
15069,
2177,
3012,
11419,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,... | 3.182681 | 843 |
import unittest
import pprint
import sys
import os
import json
import datetime
# The test object
sys.path.append('../')
from template import TemplateRex
fspec_template = 't-detail_base.html'
fspec_tsections = "./test_data/tsections_base.py"
fspec_render = "./test_data/trender_base.html"
fspec_data_flwr = "./test... | [
11748,
555,
715,
395,
198,
11748,
279,
4798,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
4818,
8079,
198,
198,
2,
383,
1332,
2134,
198,
17597,
13,
6978,
13,
33295,
10786,
40720,
11537,
198,
6738,
11055,
1330,
37... | 2.383481 | 339 |
import abc
import numpy as np
from optuna.study import Study
class BaseCrossover(object, metaclass=abc.ABCMeta):
"""Base class for crossovers.
A crossover operation is used by :class:`~optuna.samplers.NSGAIISampler`
to create new parameter combination from parameters of ``n`` parent individuals.
.... | [
11748,
450,
66,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
2172,
9613,
13,
44517,
1330,
12481,
628,
198,
4871,
7308,
34,
23954,
7,
15252,
11,
1138,
330,
31172,
28,
39305,
13,
24694,
48526,
2599,
198,
220,
220,
220,
37227... | 2.588156 | 743 |
import os
import numpy as np
from pandas import DataFrame, read_csv
from os.path import dirname, join
ROOT_DIR = dirname(dirname(os.path.realpath(__file__)))
DATA_DIR = os.path.join(ROOT_DIR, 'data')
STAN_DIR = os.path.join(ROOT_DIR, 'stan_results')
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
### Load and prepare dat... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
19798,
292,
1330,
6060,
19778,
11,
1100,
62,
40664,
198,
6738,
28686,
13,
6978,
1330,
26672,
3672,
11,
4654,
198,
13252,
2394,
62,
34720,
796,
26672,
3672,
7,
15908,
3672,
7,
... | 3.096681 | 1,386 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
2829,
17752,
355,
33918,
198,
198,
6738,
435,
541,
323,
13,
64,
404,
13,
15042,
13,
9979,
415,
13,
22973,
3418... | 2.58 | 50 |
import typing
from graphql import GraphQLUnionType
from strawberry.exceptions import UnallowedReturnTypeForUnion, WrongReturnTypeForUnion
from strawberry.type import TypeDefinition
from strawberry.union import UnionDefinition
from strawberry.utils.typing import (
get_list_annotation,
is_generic,
is_list,
... | [
11748,
19720,
198,
198,
6738,
4823,
13976,
1330,
29681,
9711,
38176,
6030,
198,
6738,
41236,
13,
1069,
11755,
1330,
791,
40845,
13615,
6030,
1890,
38176,
11,
28843,
13615,
6030,
1890,
38176,
198,
6738,
41236,
13,
4906,
1330,
5994,
36621,
... | 3.481132 | 106 |
#!/usr/bin/env python
"""
Copyright 2019 Pystol (pystol.org).
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,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
15269,
13130,
9485,
301,
349,
357,
9078,
301,
349,
13,
2398,
737,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,... | 2.015997 | 2,688 |
from django.shortcuts import render
from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView
from django.urls import reverse_lazy
from django.contrib.auth.mixins import LoginRequiredMixin
from .models import Task
from .mixins import UserTaskMixin
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
7343,
7680,
11,
42585,
7680,
11,
13610,
7680,
11,
10133,
7680,
11,
23520,
7680,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
62... | 3.594937 | 79 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Apple Spotlight store database parser."""
from __future__ import unicode_literals
import unittest
from plaso.lib import definitions
from plaso.parsers import spotlight_storedb
from tests.parsers import test_lib
class SpotlightStoreDatabaseParserTest(... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
51,
3558,
329,
262,
4196,
49014,
3650,
6831,
30751,
526,
15931,
198,
198,
6738,
11593,
37443,
834,
1330,
280... | 2.740331 | 543 |
from pathlib import Path
import chess.pgn
import pandas as pd
from datetime import date
csv_datasets_folder = Path('../../data/interim')
raw_data_folder = Path('../../data/raw')
pgn_files = sorted(raw_data_folder.glob('*.pgn'))
datasets = []
for path in pgn_files:
print(f'parsing {path}')
games = []
wit... | [
6738,
3108,
8019,
1330,
10644,
198,
11748,
19780,
13,
79,
4593,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
4818,
8079,
1330,
3128,
198,
198,
40664,
62,
19608,
292,
1039,
62,
43551,
796,
10644,
10786,
40720,
40720,
7890,
14,
3849,
... | 2.145833 | 480 |
#!/usr/bin/python3
import time
''' ####### '''
date = 5
dev = 0 # extra prints
part = 3 # 1,2, or 3 for both
samp = 0 # 0 or 1
''' ####### '''
''' ####### '''
time0 = time.time()
if samp == 1:
filename = "/sample.txt"
else:
filename = "/input.txt"
try:
with open(str(date) + f... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
640,
198,
198,
7061,
6,
220,
220,
220,
220,
46424,
2235,
220,
220,
220,
220,
705,
7061,
198,
198,
4475,
796,
642,
198,
7959,
796,
657,
1303,
3131,
20842,
198,
3911,
796,
5... | 2.168091 | 351 |
"""Tests for version.py."""
import os
import sys
import pytest
try:
# Python 2
from cStringIO import StringIO
except:
# Python 3
from io import StringIO
import hera_pspec
from .. import version
import json
| [
37811,
51,
3558,
329,
2196,
13,
9078,
526,
15931,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
12972,
9288,
198,
198,
28311,
25,
198,
220,
220,
220,
1303,
11361,
362,
198,
220,
220,
220,
422,
269,
10100,
9399,
1330,
10903,
9399,
... | 2.922078 | 77 |
# Copyright (c) 2016 Mirantis, Inc.
#
# 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... | [
2,
220,
220,
220,
15069,
357,
66,
8,
1584,
7381,
20836,
11,
3457,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,... | 3.324561 | 228 |
#!/usr/bin/env python3
################################################################################
## ___ _ ____ ____
## / _ \ _ _ ___ ___| |_| _ \| __ )
## | | | | | | |/ _ \/ __| __| | | | _ \
## | |_| | |_| | __/\__ \ |_| |_| | |_) |
## \__\_\\__,_|\___||___/\__|____/|_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
29113,
29113,
14468,
198,
2235,
220,
220,
220,
220,
46444,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
220,
220,
220,
1427,
... | 3.016129 | 496 |
from __future__ import print_function, division
import codecs
from emoji import UNICODE_EMOJI
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
7297,
198,
11748,
40481,
82,
198,
6738,
44805,
1330,
4725,
2149,
16820,
62,
3620,
46,
41,
40,
198
] | 3.481481 | 27 |
"""
This python script builds the XML files for case5a of the FHR benchmark
materials.xml, geometry.xml, settings.xml, and tallies.xml
"""
###############################################################################
# Python Package Import
######################################################... | [
37811,
198,
1212,
21015,
4226,
12188,
262,
23735,
3696,
329,
1339,
20,
64,
286,
262,
376,
17184,
18335,
198,
33665,
82,
13,
19875,
11,
22939,
13,
19875,
11,
6460,
13,
19875,
11,
290,
7331,
444,
13,
19875,
198,
198,
37811,
198,
198,
... | 2.027221 | 6,833 |
from .general import TrussBar
from .construction import TrussConstruction
__all__ = ['TrussBar', 'TrussConstruction']
| [
6738,
764,
24622,
1330,
833,
1046,
10374,
198,
6738,
764,
9979,
2762,
1330,
833,
1046,
36687,
198,
198,
834,
439,
834,
796,
37250,
2898,
1046,
10374,
3256,
705,
2898,
1046,
36687,
20520,
198
] | 3.606061 | 33 |
import os
import configparser
import getpass
from jinja2 import Environment, FileSystemLoader
import socket
import sys
deploy_dir = os.path.dirname(os.path.abspath(__file__))
module_root = os.path.dirname(deploy_dir)
properties_path = module_root + "/application.prod.cfg"
config = configparser.ConfigParser()
TEMPLATE... | [
11748,
28686,
198,
11748,
4566,
48610,
198,
11748,
651,
6603,
198,
6738,
474,
259,
6592,
17,
1330,
9344,
11,
9220,
11964,
17401,
198,
11748,
17802,
198,
11748,
25064,
198,
198,
2934,
1420,
62,
15908,
796,
28686,
13,
6978,
13,
15908,
367... | 2.213254 | 1,177 |
__all__ = ["HashableDict"]
| [
834,
439,
834,
796,
14631,
26257,
540,
35,
713,
8973,
628
] | 2.545455 | 11 |
import math
import warnings
def is_pythagorean_triplet(a,b,c):
"""
Checks if a,b and c forms pythagorean triplet i.e., a^2 + b^2 = c^2
Parameters
----------
a : int
denotes positive integer a in a^2 + b^2 = c^2
b : int
denotes positive integer b in a^2 + b^2 = c^2
c : int
... | [
11748,
10688,
198,
11748,
14601,
198,
198,
4299,
318,
62,
79,
5272,
363,
29456,
62,
28461,
37069,
7,
64,
11,
65,
11,
66,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
47719,
611,
257,
11,
65,
290,
269,
5107,
279,
5272,
363,... | 2.035411 | 706 |
#!/usr/bin/python3
'''
Summary
-------
This application simulates the cumulative PSF and compare with data (if available).
The telescope zenith angle and the source distance can be set by command line arguments.
The measured cumulative PSF should be provided by using the command line argument dat... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
7061,
6,
198,
220,
220,
220,
21293,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
770,
3586,
985,
15968,
262,
23818,
6599,
37,
290,
8996,
351,
1366,
357,
361,
1695,
737,
628,
22... | 2.456841 | 2,653 |
import os
import platform
import subprocess
import sys
import click
from pycparser import (
c_parser,
)
from .declarations import (
BUILTIN_HEADERS_DIR,
DARWIN_HEADERS_DIR,
IGNORE_DECLARATIONS,
)
from .writer import (
AutoPxd,
)
__version__ = "2.0.4"
def ensure_binary(s, encoding="utf-8", error... | [
11748,
28686,
198,
11748,
3859,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
198,
11748,
3904,
198,
6738,
12972,
13155,
28198,
1330,
357,
198,
220,
220,
220,
269,
62,
48610,
11,
198,
8,
198,
198,
6738,
764,
32446,
24355,
1330,
357,
... | 2.458333 | 984 |
"""Tools for getting spectra for lya fitting.
Includes choosing a data file for each star, reading the files, and
processing the spectral data (from either IUE, STIS, ...) into a format
that can be used directly for the fitting.
The variable target_use_which_spectrum indicates which data to use for
each star. It can ... | [
37811,
33637,
329,
1972,
5444,
430,
329,
300,
3972,
15830,
13,
198,
198,
42986,
11236,
257,
1366,
2393,
329,
1123,
3491,
11,
3555,
262,
3696,
11,
290,
198,
36948,
262,
37410,
1366,
357,
6738,
2035,
314,
8924,
11,
3563,
1797,
11,
2644,... | 2.29093 | 6,108 |
"""
String algorithms
"""
assert balanced_parens('')
assert balanced_parens('()')
assert balanced_parens('((()))')
assert balanced_parens('((()()()))')
assert balanced_parens('((()()()))()(())(()())')
assert not balanced_parens('(()')
assert not balanced_parens('((())))')
assert not balanced_parens('((()())')
assert ... | [
37811,
198,
10100,
16113,
198,
37811,
628,
198,
30493,
12974,
62,
11730,
82,
7,
7061,
8,
198,
30493,
12974,
62,
11730,
82,
10786,
3419,
11537,
198,
30493,
12974,
62,
11730,
82,
10786,
19510,
3419,
4008,
11537,
198,
30493,
12974,
62,
117... | 2.003053 | 655 |
print("Hello World")
type(3)
#How many votes did you get?
#my_votes = int(input("How many votes did you get in the election?"))
#Total votes in the election
#total_votes = int(input("What is the total votes in the election?"))
#Calculate the percentage of votes you receive
#percentage_votes = (my_votes / total_votes)*... | [
4798,
7203,
15496,
2159,
4943,
198,
4906,
7,
18,
8,
198,
198,
2,
2437,
867,
5690,
750,
345,
651,
30,
198,
2,
1820,
62,
29307,
796,
493,
7,
15414,
7203,
2437,
867,
5690,
750,
345,
651,
287,
262,
3071,
1701,
4008,
198,
2,
14957,
5... | 2.797609 | 2,258 |
import numpy as np
import pandas as pd
import torch as th
import tqdm
import os
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='.')
parser.add_argument('--include_val', help='whether include val')
parser.add_argument('--head_upsample_epochs', help='upample rate')
parser.add_ar... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28034,
355,
294,
198,
11748,
256,
80,
36020,
198,
11748,
28686,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
197,
48610,
796,
... | 2.722807 | 285 |
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2020 PANGAEA (https://www.pangaea.de/)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
17168,
13789,
198,
2,
198,
2,
15069,
357,
66,
8,
12131,
40468,
9273,
16412,
357,
5450,
1378,
2503,
13,
79,
648,
44705,
13,
2934,
34729,
198,
2,
198,
2,
2448,... | 2.123435 | 2,236 |
###############################################################################
# The MIT License (MIT)
#
# Copyright (c) 2014 Justin Lovinger
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Softwar... | [
29113,
29113,
7804,
4242,
21017,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
357,
66,
8,
1946,
10799,
39911,
3889,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
... | 2.618293 | 820 |
import unittest
from ..sequence.aligner import Aligner
if __name__ == "__main__":
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
6738,
11485,
43167,
13,
31494,
263,
1330,
978,
570,
263,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.65 | 40 |
import threading
import wsgiref.util
from wsgiref.simple_server import make_server
import http.server
import socketserver
import socket
import tweepy
import urllib.parse
def server_bind(self):
"""Override server_bind to fix UnicodeDecodeError when computer name has non-ascii characters."""
socketserver.TCPServer.ser... | [
11748,
4704,
278,
198,
11748,
266,
45213,
557,
69,
13,
22602,
198,
6738,
266,
45213,
557,
69,
13,
36439,
62,
15388,
1330,
787,
62,
15388,
198,
11748,
2638,
13,
15388,
198,
11748,
37037,
18497,
198,
11748,
17802,
198,
11748,
4184,
538,
... | 2.761468 | 1,090 |
# Copyright 2019 Filipe Assuncao
# 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,
13130,
376,
2403,
431,
2195,
19524,
5488,
198,
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,... | 1.987805 | 17,630 |
from topomc.common.coordinates import Coordinates
from topomc.processes.topomap import Depression, Hill, TopoMap
from topomc.symbol import PointSymbol
from topomc import app
| [
6738,
1353,
296,
66,
13,
11321,
13,
37652,
17540,
1330,
22819,
17540,
198,
6738,
1353,
296,
66,
13,
14681,
274,
13,
4852,
296,
499,
1330,
22483,
11,
3327,
11,
5849,
78,
13912,
198,
6738,
1353,
296,
66,
13,
1837,
23650,
1330,
6252,
1... | 3.346154 | 52 |
# Created by Egor Kostan.
# GitHub: https://github.com/ikostan
# LinkedIn: https://www.linkedin.com/in/egor-kostan/
def first_non_consecutive(arr: list):
"""
Find the first element of an array that is not consecutive.
E.g. If we have an array [1,2,3,4,6,7,8] then 1 then 2 then 3
then 4 are all con... | [
2,
220,
15622,
416,
412,
7053,
509,
455,
272,
13,
198,
2,
220,
21722,
25,
3740,
1378,
12567,
13,
785,
14,
1134,
455,
272,
198,
2,
220,
27133,
25,
3740,
1378,
2503,
13,
25614,
259,
13,
785,
14,
259,
14,
1533,
273,
12,
74,
455,
... | 2.563265 | 245 |
OVERTIME_LIMIT = 40.0
hours = input("Enter Hours:")
hours_f = float(hours)
rate = input("Enter Rate:")
rate_f = float(rate)
pay = computepay(hours_f, rate_f)
print("Pay", pay)
| [
46,
15858,
12789,
62,
43,
3955,
2043,
796,
2319,
13,
15,
198,
198,
24425,
796,
5128,
7203,
17469,
19347,
25,
4943,
198,
24425,
62,
69,
796,
12178,
7,
24425,
8,
198,
198,
4873,
796,
5128,
7203,
17469,
14806,
25,
4943,
198,
4873,
62,
... | 2.445946 | 74 |
from django.urls import path
from modules.users.index import (
user_info,
user_tweets,
user_medias,
user_replies,
user_likes,
)
urlpatterns = [
path("", user_info, name="info"),
path("tweets", user_tweets, name="tweets"),
path("medias", user_medias, name="medias"),
path("likes", us... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
13103,
13,
18417,
13,
9630,
1330,
357,
198,
220,
220,
220,
2836,
62,
10951,
11,
198,
220,
220,
220,
2836,
62,
83,
732,
1039,
11,
198,
220,
220,
220,
2836,
62,
2379,
292... | 2.39521 | 167 |
#!/usr/bin/env python
import datetime
import json
import logging
import os
from typing import Optional, List, Dict
from raft_peer import Peer
LOG = logging.getLogger(__name__)
LOG.setLevel(logging.DEBUG)
class LeaderVolatileState(object):
"""
Volatile state on leaders: (Reinitialized after election)
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
4818,
8079,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
6738,
19720,
1330,
32233,
11,
7343,
11,
360,
713,
198,
198,
6738,
31812,
62,
33350,
1330,
41139,
198,
198... | 2.76285 | 856 |
import sys
import skdd.core as core
if __name__ == "__main__":
if len(sys.argv) > 1:
filename = sys.argv[1]
else:
filename = 'test.xlsx'
core.analysis(filename)
| [
11748,
25064,
198,
198,
11748,
1341,
1860,
13,
7295,
355,
4755,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
611,
18896,
7,
17597,
13,
853,
85,
8,
1875,
352,
25,
198,
220,
220,
220,
220,
2... | 2.157303 | 89 |
import os
import Errors as err
import Settings as props
import FileHandler as fl
import JSONHandler as js
from ProjectClass import Project | [
11748,
28686,
198,
11748,
44225,
355,
11454,
198,
11748,
16163,
355,
25744,
198,
11748,
9220,
25060,
355,
781,
198,
11748,
19449,
25060,
355,
44804,
198,
6738,
4935,
9487,
1330,
4935
] | 4.6 | 30 |
import csv
import os
import re
from concurrent import futures
from concurrent.futures import ThreadPoolExecutor
from html.parser import HTMLParser
from operator import itemgetter
from urllib import request
from urllib.error import HTTPError
def csv_to_list(filename: str) -> list:
"""Receive an csv filename and re... | [
11748,
269,
21370,
198,
11748,
28686,
198,
11748,
302,
198,
6738,
24580,
1330,
25650,
198,
6738,
24580,
13,
69,
315,
942,
1330,
14122,
27201,
23002,
38409,
198,
6738,
27711,
13,
48610,
1330,
11532,
46677,
198,
6738,
10088,
1330,
2378,
113... | 2.508824 | 1,700 |
#!/usr/bin/env python
import os
from lib import Udger
def is_crawler(client_ip):
"""
:return: crawler or not
"""
data_dir = os.path.join(os.path.dirname(__file__), 'data')
udger = Udger(data_dir)
return True if udger.parse_ip(client_ip)['ip_classification_code'] == 'crawler' else False
d... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
198,
6738,
9195,
1330,
35774,
1362,
628,
198,
4299,
318,
62,
66,
39464,
7,
16366,
62,
541,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1058,
7783,
25... | 2.276995 | 426 |
import unittest
from pylti1p3.utils import add_param_to_url
| [
11748,
555,
715,
395,
198,
6738,
12972,
2528,
72,
16,
79,
18,
13,
26791,
1330,
751,
62,
17143,
62,
1462,
62,
6371,
628
] | 2.652174 | 23 |
import platform
import importlib
import itertools
_init()
__all__ = [
name
for name, func in globals().items()
if callable(func) and not name.startswith('_')
]
| [
11748,
3859,
198,
11748,
1330,
8019,
198,
11748,
340,
861,
10141,
628,
628,
198,
62,
15003,
3419,
628,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
1438,
198,
220,
220,
220,
329,
1438,
11,
25439,
287,
15095,
874,
22446,
23814,
... | 2.69697 | 66 |
# coding=utf-8
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from v.ui_acerca_de import Ui_Acerca_de
| [
2,
19617,
28,
40477,
12,
23,
198,
6738,
9485,
48,
83,
19,
13,
48,
83,
8205,
72,
1330,
1635,
198,
6738,
9485,
48,
83,
19,
13,
48,
83,
14055,
1330,
1635,
198,
198,
6738,
410,
13,
9019,
62,
330,
2798,
64,
62,
2934,
1330,
471,
72,... | 2.056604 | 53 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import find_packages, setup
here = os.path.abspath(os.path.dirname(__file__))
# Package meta-data.
NAME = "neuromodels"
DESCRIPTION = "Computational neuroscience models and model tools."
URL = "https://github.com/nicolossus/neuromodels"
EMAIL =... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
198,
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
11,
9058,
198,
198,
1456,
796,
28686,
13,
... | 2.231214 | 692 |
"""
Contains classes which serve to provide functionalities that handle calculations
involving coordinate systems.
"""
import sys
from math import atan, pi
from coordinatesystem.component import Point2D
from coordinatesystem.component import Line2D
from coordinatesystem.exceptions import ZeroDistanceError
class Equi... | [
37811,
198,
4264,
1299,
6097,
543,
4691,
284,
2148,
10345,
871,
326,
5412,
16765,
198,
259,
10396,
1075,
20435,
3341,
13,
198,
37811,
198,
198,
11748,
25064,
198,
6738,
10688,
1330,
379,
272,
11,
31028,
198,
198,
6738,
22715,
6781,
13,
... | 3.077289 | 841 |
# Generated by Django 2.2.7 on 2020-01-23 06:35
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
22,
319,
12131,
12,
486,
12,
1954,
9130,
25,
2327,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.818182 | 44 |