content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from os import stat
from callbacks import start
from util.serializers import EnrollmentPaymentSerializer
from util.errors import BackendError, catch_error
from util.api_service import ApiService
from util.telegram_service import TelegramService
from util.constants import EventInstance, Folder, FolderPermission, State, ... | [
6738,
28686,
1330,
1185,
198,
6738,
869,
10146,
1330,
923,
198,
6738,
7736,
13,
46911,
11341,
1330,
2039,
48108,
19197,
434,
32634,
7509,
198,
6738,
7736,
13,
48277,
1330,
5157,
437,
12331,
11,
4929,
62,
18224,
198,
6738,
7736,
13,
1504... | 3.886364 | 132 |
# -*- coding:utf-8 -*-
from .resnet import resnet18, resnet34
from .mobilenet import mobilenet_v2
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
220,
532,
9,
12,
198,
198,
6738,
764,
411,
3262,
1330,
581,
3262,
1507,
11,
581,
3262,
2682,
198,
6738,
764,
76,
25898,
268,
316,
1330,
17754,
268,
316,
62,
85,
17,
198
] | 2.380952 | 42 |
atan2(1,sqrt(3)) | [
39036,
17,
7,
16,
11,
31166,
17034,
7,
18,
4008
] | 1.6 | 10 |
#!python3
#encoding: utf-8
import htmlstr.HtmlWrapper
class HtmlBase(object):
"""
HTML文書文字列を生成する。
@param {str} bodyは<body>に含めるHTML文字列。
@param {str} headは<head>に含めるHTML文字列。
@param {dict} metaは<meta>に入れるデータ。次のキーを持ったdict型。'charset', 'description', 'author', 'viewport', 'title', 'icon_href', 'css_href'... | [
2,
0,
29412,
18,
198,
2,
12685,
7656,
25,
3384,
69,
12,
23,
198,
11748,
27711,
2536,
13,
39,
20369,
36918,
2848,
198,
4871,
367,
20369,
14881,
7,
15252,
2599,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
11532,
23877,
229,
162,
... | 1.75 | 188 |
"""Chrome."""
from typing import List, Optional
import selenium.webdriver
from selenium.webdriver.chrome.options import Options
from surferrr.base.base_browser import BaseBrowser
ARGUMENT_HEADLESS = '--headless'
class Chrome(BaseBrowser):
"""Chrome."""
def __init__(self,
headless: bool =... | [
37811,
1925,
5998,
526,
15931,
198,
198,
6738,
19720,
1330,
7343,
11,
32233,
198,
198,
11748,
384,
11925,
1505,
13,
12384,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
46659,
13,
25811,
1330,
18634,
198,
198,
6738,
969,
223... | 2.167726 | 787 |
from models import StackedHourGlass, Linear
import torch
from tqdm import tqdm
import torchvision.transforms as transforms
from utils.data import ImageSequence, SurrealDataset, get_order_joint_human, Human36M
from utils import Config, get_2d_joints, get_all_32joints
from torch.utils.data import DataLoader
import os
imp... | [
6738,
4981,
1330,
520,
6021,
43223,
47698,
11,
44800,
198,
11748,
28034,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
28034,
10178,
13,
7645,
23914,
355,
31408,
198,
6738,
3384,
4487,
13,
7890,
1330,
7412,
44015,
594,
11... | 2.458591 | 1,618 |
from typing import Dict, Optional, Union, List
import datasets
from fewie.data.datasets import NER_DATASETS_ROOT
def load_dataset(
dataset_name: str,
split: str,
version: Optional[str] = None,
data_dir: Optional[str] = None,
) -> Union[datasets.Dataset, datasets.DatasetDict]:
"""Loads a dataset w... | [
6738,
19720,
1330,
360,
713,
11,
32233,
11,
4479,
11,
7343,
198,
198,
11748,
40522,
198,
6738,
1178,
494,
13,
7890,
13,
19608,
292,
1039,
1330,
399,
1137,
62,
35,
1404,
1921,
32716,
62,
13252,
2394,
628,
198,
4299,
3440,
62,
19608,
... | 2.610043 | 936 |
#!/usr/bin/python
import tensorflow as tf
from edward.models import Normal
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
1225,
904,
13,
27530,
1330,
14435,
198
] | 3.166667 | 24 |
from crawler.frontier import Frontier
from crawler.worker import Worker
| [
6738,
27784,
1754,
13,
8534,
959,
1330,
23281,
198,
6738,
27784,
1754,
13,
28816,
1330,
35412,
198
] | 4.235294 | 17 |
# coding: utf-8
"""
Gate API v4
Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501
Contact: support@mail.gate.io
Gen... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
12816,
7824,
410,
19,
628,
220,
220,
220,
19134,
284,
12816,
13,
952,
7824,
220,
7824,
85,
19,
3769,
4136,
11,
10330,
290,
25650,
7313,
4560,
13,
1318,
389,
1171... | 2.334373 | 62,816 |
#!/usr/bin/python
'''
This file is part of pyfuzz.
Copyright 2009 Frederic Morcos <fred.morcos@gmail.com>
pyfuzz is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
7061,
6,
197,
198,
220,
197,
1212,
2393,
318,
636,
286,
12972,
69,
4715,
13,
198,
220,
198,
220,
197,
15269,
3717,
197,
30847,
35626,
3461,
6966,
1279,
39193,
13,
4491,
6966,
31,
14816,
13,... | 2.31717 | 1,258 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import argparse
from time import time
from datetime import datetime
import numpy as np
try:
import tensorflow_gpu as tf
except:
import tensorflow as tf
from keras import backend as K
from keras.layers import Input, Dense, ELU, Dropout, BatchNormalization
from keras... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
1822,
29572,
198,
6738,
640,
1330,
640,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
299,
... | 2.879447 | 2,389 |
"""Application Models."""
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
| [
37811,
23416,
32329,
526,
15931,
198,
198,
6738,
22397,
42725,
1330,
7032,
11,
10011,
2611,
198,
6738,
22397,
42725,
13,
12102,
378,
1330,
1881,
5189,
198,
6738,
11485,
268,
5700,
1330,
1635,
198,
6738,
11485,
27530,
13,
14881,
27054,
261... | 3.283333 | 60 |
# -*- coding:utf-8 -*-
#
# Copyright (C) 2008 The Android Open Source Project
#
# 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 re... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
34,
8,
3648,
383,
5565,
4946,
8090,
4935,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
19... | 3.256318 | 277 |
"""Module with helpers to declare capabilities and plugin behavior."""
from enum import Enum, EnumMeta
from typing import Any, Optional
from warnings import warn
class DeprecatedEnum(Enum):
"""Base class for capabilities enumeration."""
def __new__(cls, value: Any, deprecation: Optional[str] = None) -> "Dep... | [
37811,
26796,
351,
49385,
284,
13627,
9889,
290,
13877,
4069,
526,
15931,
198,
198,
6738,
33829,
1330,
2039,
388,
11,
2039,
388,
48526,
198,
6738,
19720,
1330,
4377,
11,
32233,
198,
6738,
14601,
1330,
9828,
628,
198,
4871,
2129,
31023,
... | 2.441545 | 1,993 |
from .resource import ResourceAPI
| [
6738,
764,
31092,
1330,
20857,
17614,
628
] | 5 | 7 |
"""ParameterMap class"""
from typing import List, Dict, Tuple
import hjson
import copy
import numpy as np
import tensorflow as tf
from c3.c3objs import Quantity
from c3.signal.gates import Instruction
from c3.signal.pulse import components as comp_lib
class ParameterMap:
"""
Collects information about contro... | [
37811,
36301,
13912,
1398,
37811,
198,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
11,
309,
29291,
198,
11748,
289,
17752,
198,
11748,
4866,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
269,
... | 2.013092 | 4,201 |
import asyncio
import datetime
import json
import pathlib
import cleo
import pkg_resources
import structlog
from wraeblast import errors, insights, logging
from wraeblast.filtering.parsers.extended import config, loads, render
from wraeblast.filtering.serializers.standard import dumps
log = structlog.get_logger()
... | [
11748,
30351,
952,
198,
11748,
4818,
8079,
198,
11748,
33918,
198,
11748,
3108,
8019,
198,
198,
11748,
1190,
78,
198,
11748,
279,
10025,
62,
37540,
198,
11748,
2878,
6404,
198,
198,
6738,
7917,
1765,
12957,
1330,
8563,
11,
17218,
11,
18... | 2.880466 | 343 |
import numpy as np
import matplotlib.pyplot as plt
rt = np.loadtxt('./responseTime_t1rm.out')
fig1, ax1 = plt.subplots()
n = np.arange(1,len(rt)+1) / np.float(len(rt)) * 100
rtSorted = np.sort(rt)
ax1.step(rtSorted, n, color='k', label='task t1rm')
ax1.set_xlabel('Response Time (microseconds)')
ax1.set_ylabel('Perc... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
17034,
796,
45941,
13,
2220,
14116,
7,
4458,
14,
26209,
7575,
62,
83,
16,
26224,
13,
448,
11537,
198,
198,
5647,
16,
11,
7877,
16... | 2.236967 | 211 |
from .... pyaz_utils import _call_az
def list(resource_group, workspace_name):
'''
List all firewall rules.
Required Parameters:
- resource_group -- Name of resource group. You can configure the default group using `az configure --defaults group=<name>`
- workspace_name -- The workspace name.
... | [
6738,
19424,
12972,
1031,
62,
26791,
1330,
4808,
13345,
62,
1031,
198,
198,
4299,
1351,
7,
31092,
62,
8094,
11,
44573,
62,
3672,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
7343,
477,
32928,
3173,
13,
628,
220,
220,
220... | 3.377517 | 1,192 |
"""
Author: Ryan Faulkner
Date: October 19th, 2014
Container for mashup logic.
"""
import json
import random
from sqlalchemy.orm.exc import UnmappedInstanceError
from flickipedia.redisio import DataIORedis
from flickipedia.model.articles import ArticleModel, ArticleContentModel
from flickipedia.config ... | [
37811,
198,
220,
220,
220,
6434,
25,
6047,
44760,
74,
1008,
198,
220,
220,
220,
7536,
25,
220,
220,
3267,
678,
400,
11,
1946,
628,
220,
220,
220,
43101,
329,
30407,
929,
9156,
13,
198,
37811,
198,
198,
11748,
33918,
198,
11748,
4738... | 2.251296 | 4,051 |
# coding: utf-8
# # Chart Presentation (6) - Adding a source annotation
# In this lesson we'll put into practise what we've learnt so far about creating and positioning annotations and increasing the margins of our charts to add a source annotation to some charts that we've previously created.
#
# Citing and refer... | [
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
1303,
22086,
21662,
341,
357,
21,
8,
532,
18247,
257,
2723,
23025,
198,
198,
2,
554,
428,
11483,
356,
1183,
1234,
656,
44811,
644,
356,
1053,
26338,
523,
1290,
546,
4441,
290,
2209... | 2.417652 | 2,198 |
# Copyright 2021 Jonas Hallqvist
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | [
2,
15069,
33448,
40458,
4789,
44179,
396,
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,
2,
921,
... | 2.332716 | 1,620 |
from great_expectations.core.usage_statistics.anonymizers.action_anonymizer import (
ActionAnonymizer,
)
from great_expectations.core.usage_statistics.anonymizers.anonymizer import Anonymizer
from great_expectations.validation_operators import (
ActionListValidationOperator,
ValidationOperator,
WarningA... | [
6738,
1049,
62,
1069,
806,
602,
13,
7295,
13,
26060,
62,
14269,
3969,
13,
272,
5177,
11341,
13,
2673,
62,
272,
5177,
7509,
1330,
357,
198,
220,
220,
220,
7561,
2025,
5177,
7509,
11,
198,
8,
198,
6738,
1049,
62,
1069,
806,
602,
13,... | 3.153846 | 117 |
from aoc_input import get_input
import aoc_helpers as ah
import re
try:
from tabulate import tabulate
except ImportError:
tabulate = lambda *_: print("The tabulate module seems to be missing")
RE_TICKET = re.compile(r"^(.*): (\d+)-(\d+) or (\d+)-(\d+)$")
DAY = 16
YEAR = 2020
| [
6738,
257,
420,
62,
15414,
1330,
651,
62,
15414,
198,
11748,
257,
420,
62,
16794,
364,
355,
29042,
198,
198,
11748,
302,
198,
28311,
25,
198,
197,
6738,
7400,
5039,
1330,
7400,
5039,
198,
16341,
17267,
12331,
25,
198,
197,
8658,
5039,... | 2.626168 | 107 |
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
# firefox plugin
# https://askubuntu.com/questions/870530/how-to-install-geckodriver-in-ubuntu
# hide browser window
chrome_options = Options()
chrome_options.add_argument("--headless") # define headless
# add the option when ... | [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
46659,
13,
25811,
1330,
18634,
198,
198,
2,
2046,
12792,
13877,
198,
2,
3740,
1378,
2093,
32230,
13,
785,
14,
6138,
507,
14,
23,
34801,
1270... | 2.573099 | 342 |
import unittest
from textwrap import dedent
import trafaret as T
from .util import get_err
| [
11748,
555,
715,
395,
198,
6738,
2420,
37150,
1330,
4648,
298,
198,
198,
11748,
1291,
69,
8984,
355,
309,
198,
6738,
764,
22602,
1330,
651,
62,
8056,
628,
628
] | 3.275862 | 29 |
# 根据每日 气温 列表,请重新生成一个列表,对应位置的输入是你需要再等待多久温度才会升高超过该日的天数。如果之后都不会升高,请在该位置用 0 来代替。
#
# 例如,给定一个列表 temperatures = [73, 74, 75, 71, 69, 72, 76, 73],你的输出应该是 [1, 1, 4, 2, 1, 1, 0, 0]。
#
# 提示:气温 列表长度的范围是 [1, 30000]。每个气温的值的均为华氏度,都是在 [30, 100] 范围内的整数。
#
# 来源:力扣(LeetCode)
# 链接:https://leetcode-cn.com/problems/daily-temperatures
# 著作权... | [
2,
10545,
254,
117,
162,
235,
106,
162,
107,
237,
33768,
98,
10545,
108,
242,
162,
116,
102,
10263,
230,
245,
26193,
101,
171,
120,
234,
46237,
115,
34932,
235,
23877,
108,
37955,
22755,
238,
31660,
10310,
103,
26344,
245,
26193,
101,... | 0.942197 | 519 |
from pip._internal.utils.appdirs import user_cache_dir
# The user_cache_dir helper comes straight from pip itself
CACHE_DIR = user_cache_dir("pip-tools")
| [
6738,
7347,
13557,
32538,
13,
26791,
13,
1324,
15908,
82,
1330,
2836,
62,
23870,
62,
15908,
198,
198,
2,
383,
2836,
62,
23870,
62,
15908,
31904,
2058,
3892,
422,
7347,
2346,
198,
34,
2246,
13909,
62,
34720,
796,
2836,
62,
23870,
62,
... | 3.1 | 50 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'form.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
import os
import sys
import time
import traceback
from os.path import join
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt... | [
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,
687,
13,
9019,
6,
198,
2,
198,
2,
15622,
416,
25,
9485,
48,
83,
20,
12454,
2438,
17301,
642,
13,
24,
13,
... | 2.781893 | 243 |
import argparse, librosa
import numpy as np
import torch
import torch.nn as nn
import torchaudio
from model import Tacotron as Tacotron
from collate_fn import collate_fn
from dataset import *
from util import *
from griffin_lim import GLA
from audio_processing import *
parser = argparse.ArgumentParser(description='t... | [
11748,
1822,
29572,
11,
9195,
4951,
64,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
24051,
198,
198,
6738,
2746,
1330,
26075,
313,
1313,
355,
26075,
313,
131... | 2.868676 | 929 |
_base_ = [
'../_base_/models/faster_rcnn_r50_fpn_all_layer_SE_low_nms_score.py', '../_base_/datasets/voc0712_with_ClassBalancedDataset_config_and_data_augumentation.py',
'../_base_/default_runtime.py'
]
model = dict(roi_head=dict(bbox_head=dict(num_classes=4)))
# optimizer
optimizer = dict(type='SGD', lr=0.0025... | [
62,
8692,
62,
796,
685,
198,
220,
220,
220,
705,
40720,
62,
8692,
62,
14,
27530,
14,
69,
1603,
62,
6015,
20471,
62,
81,
1120,
62,
69,
21999,
62,
439,
62,
29289,
62,
5188,
62,
9319,
62,
77,
907,
62,
26675,
13,
9078,
3256,
705,
... | 2.545161 | 310 |
import asyncio
import vaex.jupyter
import time
import pytest
@pytest.mark.asyncio
@pytest.mark.parametrize("reentrant", [False, True])
@pytest.mark.parametrize("as_coroutine", [False, True])
@pytest.mark.parametrize("as_method", [False, True])
| [
11748,
30351,
952,
198,
11748,
46935,
1069,
13,
73,
929,
88,
353,
198,
11748,
640,
198,
11748,
12972,
9288,
628,
198,
31,
9078,
9288,
13,
4102,
13,
292,
13361,
952,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,... | 2.545455 | 99 |
from math import pi, sin, cos
import os
from OpenGL.GL import *
from OpenGL.GLUT import *
from PIL import Image
def set_img(name, path, imgID):
'''画像の設定: name.pngを読み込む
Parameters
----------
name : str
画像のファイル名.
path : str > 'W', 'B'
画像があるフォルダ名.
imgID ... | [
6738,
10688,
1330,
31028,
11,
7813,
11,
8615,
201,
198,
11748,
28686,
201,
198,
6738,
30672,
13,
8763,
1330,
1635,
201,
198,
6738,
30672,
13,
8763,
3843,
1330,
1635,
201,
198,
201,
198,
6738,
350,
4146,
1330,
7412,
201,
198,
201,
198,... | 1.443213 | 4,059 |
from collections import OrderedDict
import json
import base64
| [
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
11748,
33918,
198,
11748,
2779,
2414,
628,
220,
220,
220,
220,
220,
220,
220,
220,
628,
198
] | 2.96 | 25 |
from abc import abstractmethod
from typing import List, Match
import datetime
from recognizers_text.extractor import ExtractResult
from recognizers_date_time.date_time.date_extractor import DateExtractor
from recognizers_date_time.date_time.constants import Constants
from recognizers_text.utilities import RegExpUtilit... | [
6738,
450,
66,
1330,
12531,
24396,
198,
6738,
19720,
1330,
7343,
11,
13225,
198,
11748,
4818,
8079,
198,
6738,
3018,
11341,
62,
5239,
13,
2302,
40450,
1330,
29677,
23004,
198,
198,
6738,
3018,
11341,
62,
4475,
62,
2435,
13,
4475,
62,
... | 3.845238 | 84 |
import sys
from automlstreams.streams import KafkaStream
from automlstreams.meta import MetaClassifier
from skmultiflow.trees import HoeffdingTree
from skmultiflow.evaluation import EvaluatePrequential
from kafka import KafkaConsumer, KafkaProducer
from io import StringIO
import pandas as pd
import numpy as np
from co... | [
11748,
25064,
198,
6738,
3557,
75,
5532,
82,
13,
5532,
82,
1330,
46906,
12124,
198,
6738,
3557,
75,
5532,
82,
13,
28961,
1330,
30277,
9487,
7483,
198,
6738,
1341,
16680,
361,
9319,
13,
83,
6037,
1330,
367,
2577,
487,
12083,
27660,
198... | 2.738589 | 241 |
#!/usr/bin/env python3
# _*_ coding:utf-8 _*_
import requests
import re
import urllib
import binascii
from Config.config_requests import headers
requests.packages.urllib3.disable_warnings()
########################################################################################################################
# 脚本信息... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
4808,
9,
62,
19617,
25,
40477,
12,
23,
4808,
9,
62,
198,
198,
11748,
7007,
198,
11748,
302,
198,
11748,
2956,
297,
571,
198,
11748,
9874,
292,
979,
72,
198,
6738,
17056,
13,... | 3.164773 | 176 |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Compare the artifacts from two builds."""
import ast
import difflib
import json
import optparse
import os
import re
import shutil
i... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
1946,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,... | 2.233653 | 4,802 |
import http.client, urllib.request, urllib.parse, urllib.error, base64
import requests
from src.util.env import get_env
from src.util import log
headers = {
# Request headers
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': get_env('CV_API'),
}
params = urllib.parse.urlencode({
# Reque... | [
11748,
2638,
13,
16366,
11,
2956,
297,
571,
13,
25927,
11,
2956,
297,
571,
13,
29572,
11,
2956,
297,
571,
13,
18224,
11,
2779,
2414,
198,
11748,
7007,
198,
6738,
12351,
13,
22602,
13,
24330,
1330,
651,
62,
24330,
198,
6738,
12351,
1... | 2.718563 | 167 |
from functools import wraps
from threading import Lock
mutex: Lock = Lock()
def synchronized():
"""
Notice: currently does not support nested locking beware will result in a deadlock
"""
return wrapper
| [
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
4704,
278,
1330,
13656,
198,
21973,
1069,
25,
13656,
796,
13656,
3419,
628,
198,
4299,
47192,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
17641,
25,
3058,
8... | 3.446154 | 65 |
#!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
=========
fMRI: FSL
=========
A workflow that uses fsl to perform a first level analysis on the nipype
tutorial data set::
python fmri_fsl.py
First tell python where to fin... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
795,
16436,
25,
532,
9,
12,
4235,
25,
21015,
26,
12972,
12,
521,
298,
12,
28968,
25,
604,
26,
33793,
12,
8658,
82,
12,
14171,
25,
18038,
532,
9,
12,
198,
2,
25357,
25,
900,
... | 2.765837 | 6,551 |
# -*- coding: utf-8 -*-
#@+leo-ver=5-thin
#@+node:ekr.20161021090740.1: * @file ../commands/checkerCommands.py
#@@first
'''Commands that invoke external checkers'''
#@+<< imports >>
#@+node:ekr.20161021092038.1: ** << imports >> checkerCommands.py
import leo.core.leoGlobals as g
try:
# pylint: disable=import-error
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
31,
10,
293,
78,
12,
332,
28,
20,
12,
40871,
198,
2,
31,
10,
17440,
25,
988,
81,
13,
5304,
15377,
14454,
2998,
1821,
13,
16,
25,
1635,
2488,
7753,
11485,
14,
... | 1.931186 | 10,027 |
from datetime import datetime
from os import makedirs, chdir, walk
from os.path import join, isdir, basename, exists, relpath
from shutil import make_archive, rmtree, copyfile, move
from tempfile import mkdtemp
import re
import tempfile
import sys
from pkg_resources import get_distribution
from bagit import Bag, make_... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
28686,
1330,
285,
4335,
17062,
11,
442,
15908,
11,
2513,
198,
6738,
28686,
13,
6978,
1330,
4654,
11,
318,
15908,
11,
1615,
12453,
11,
7160,
11,
823,
6978,
198,
6738,
4423,
346,
1330,
787,... | 2.163318 | 2,737 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019~2999 - Cologler <skyoflw@gmail.com>
# ----------
#
# ----------
import datetime
from collections import Mapping
from click import get_current_context
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
66,
8,
13130,
93,
1959,
2079,
532,
327,
928,
1754,
1279,
15688,
1659,
75,
86,
31,
14816,
13,
785,
29,
198,
2,
24200,
438,
198,
2,
198,
2,
... | 2.76 | 75 |
x=1
while x>0:
Seconds = input ('Please enter any amount of seconds')
Y=Seconds/60.0000/60/24/365
if Y>100:
print "No the baby won't live"
else:
print "Yes the baby will live"
print "There are %d years in %d Seconds" % (Y, Seconds)
name = input ('')
| [
87,
28,
16,
198,
4514,
2124,
29,
15,
25,
198,
220,
220,
220,
40876,
796,
5128,
19203,
5492,
3802,
597,
2033,
286,
4201,
11537,
198,
220,
220,
220,
575,
28,
12211,
82,
14,
1899,
13,
2388,
14,
1899,
14,
1731,
14,
24760,
198,
220,
... | 2.357724 | 123 |
from __future__ import absolute_import, division, print_function
from six.moves import range
'''
Standard command-line parser for CCTBX programs
The CCTBXParser class will read files and process PHIL parameters from the
command-line as well as have standard command-line flags for showing the
PHIL scope and citations ... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
6738,
2237,
13,
76,
5241,
1330,
2837,
198,
198,
7061,
6,
198,
23615,
3141,
12,
1370,
30751,
329,
327,
4177,
33,
55,
4056,
198,
198,
464,
327,
4177,
... | 3.219769 | 951 |
from collections import Iterable
import numpy as np
import litenn as nn
import litenn.core as nc
def resize2D_bilinear(input_t, size_or_output_hw):
"""
resize2D_bilinear operator
arguments
size_or_output_hw int
float
Iterable of height,we... | [
6738,
17268,
1330,
40806,
540,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
6578,
1697,
355,
299,
77,
198,
11748,
6578,
1697,
13,
7295,
355,
299,
66,
198,
198,
4299,
47558,
17,
35,
62,
33473,
259,
451,
7,
15414,
62,
83,
11,
2546,... | 2.005871 | 511 |
from .basic import *
from .Feature import *
from .builtin_features import *
feature = Feature | [
6738,
764,
35487,
1330,
1635,
198,
6738,
764,
38816,
1330,
1635,
198,
6738,
764,
18780,
259,
62,
40890,
1330,
1635,
198,
30053,
796,
27018
] | 3.875 | 24 |
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'languages',
'dependencies': [
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert',
... | [
2,
15069,
1584,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
90,
198,
... | 2.201224 | 1,471 |
# This is not a valid Python module - Don't run it.
>>> _ = list
>>> test = [2, 5, 8, 0, 0, 1, 0]
>>> _(filter(None, test))
[2, 5, 8, 1]
>>> _(filter(lambda x: x, test)) # equivalent to previous one
[2, 5, 8, 1]
>>> _(filter(lambda x: x > 4, test)) # keep only items > 4
[5, 8]
| [
2,
770,
318,
407,
257,
4938,
11361,
8265,
532,
2094,
470,
1057,
340,
13,
198,
198,
33409,
4808,
796,
1351,
198,
33409,
1332,
796,
685,
17,
11,
642,
11,
807,
11,
657,
11,
657,
11,
352,
11,
657,
60,
198,
33409,
4808,
7,
24455,
7,
... | 2.401709 | 117 |
import feedparser
import listparser
import argparse
import time
import datetime
if __name__ == "__main__":
main()
| [
11748,
3745,
48610,
198,
11748,
1351,
48610,
198,
11748,
1822,
29572,
198,
11748,
640,
198,
11748,
4818,
8079,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 3.216216 | 37 |
# -*- coding: utf-8
import unittest
import time
import datetime
import math
from mock import patch, Mock
from blinds_lib import Blind
if __name__ == '__main__':
unittest.main()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
198,
11748,
555,
715,
395,
198,
11748,
640,
198,
11748,
4818,
8079,
198,
11748,
10688,
198,
6738,
15290,
1330,
8529,
11,
44123,
198,
6738,
7770,
82,
62,
8019,
1330,
24507,
198,
198,
361,
... | 2.95082 | 61 |
import binascii
import os
from textwrap import dedent
from pyramid.compat import native_
from pyramid.scaffolds.template import Template # API
class PyramidTemplate(Template):
"""
A class that can be used as a base class for Pyramid scaffolding
templates.
"""
def pre(self, command, output_dir,... | [
11748,
9874,
292,
979,
72,
198,
11748,
28686,
198,
6738,
2420,
37150,
1330,
4648,
298,
198,
198,
6738,
27944,
13,
5589,
265,
1330,
6868,
62,
198,
198,
6738,
27944,
13,
1416,
2001,
10119,
13,
28243,
1330,
37350,
220,
1303,
7824,
198,
1... | 2.477419 | 775 |
#!/usr/bin/env python2.7
import numpy as np
import matplotlib.pyplot as plt
Freq=np.array([30,40,45,50,55,60,65,70,80,90,95,100,105,110,125,130,140,145,150,160,170,180,190,195,200,210,220,230,240,245,250,260,270,280,290,295,300,305,310,320,325,330,335,340,345,350,355,360])
Db=np.array([70,77,86.7,97.2,90.4,87.7,87.2,8... | [
2,
48443,
14629,
14,
8800,
14,
24330,
197,
29412,
17,
13,
22,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
20366,
80,
28,
37659,
13,
18747,
26933,
1270,
11,
1821,
11,
22... | 1.755789 | 475 |
# Copyright 2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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,
15069,
2813,
4946,
25896,
5693,
198,
2,
15069,
2211,
19764,
11421,
13,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
407,
779,
428,
23... | 3.294118 | 408 |
# Copyright 2014 0xc0170
#
# 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, soft... | [
2,
15069,
1946,
657,
25306,
486,
2154,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,... | 3.813333 | 150 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Invoice) on 2019-07-29.
# 2019, SMART Health IT.
import sys
from dataclasses import dataclass
from typing import ClassVar, Optional, List
from .fhirabstractbase import empty_list
from .anno... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
220,
2980,
515,
422,
376,
39,
4663,
604,
13,
15,
13,
15,
12,
64,
4310,
721,
21,
1453,
16,
65,
357,
4... | 3.300203 | 986 |
import unittest
from checkov.terraform.context_parsers.registry import parser_registry
from tests.terraform.context_parsers.mock_context_parser import MockContextParser
import os
mock_definition = (os.path.dirname(os.path.realpath(__file__)) + '/mock_tf_files/mock.tf', {'mock': [
{
'mock_type': {
... | [
11748,
555,
715,
395,
198,
198,
6738,
2198,
709,
13,
353,
430,
687,
13,
22866,
62,
79,
945,
364,
13,
2301,
4592,
1330,
30751,
62,
2301,
4592,
198,
6738,
5254,
13,
353,
430,
687,
13,
22866,
62,
79,
945,
364,
13,
76,
735,
62,
2286... | 2.14554 | 213 |
# -*- coding: utf-8 -*-
"""Provides regridding for irregular grids."""
import ESMF
import iris
import numpy as np
from ._mapping import get_empty_data, map_slices, ref_to_dims_index
ESMF_MANAGER = ESMF.Manager(debug=False)
ESMF_LON, ESMF_LAT = 0, 1
ESMF_REGRID_METHODS = {
'linear': ESMF.RegridMethod.BILINEAR,... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
15946,
1460,
842,
81,
13494,
329,
21388,
50000,
526,
15931,
198,
198,
11748,
412,
12310,
37,
198,
11748,
4173,
271,
198,
11748,
299,
32152,
355,
45941,
198,
198,
... | 2.051411 | 5,777 |
import datetime
import logging
from django import test
from services.common import misc, helpers as db_tools
from services.configuration.jrpc.serializers import channels as \
channel_serializers
from services.configuration.jrpc.views import rules as jrpc_rules
from services.configuration.jrpc.views.channels impor... | [
198,
11748,
4818,
8079,
198,
11748,
18931,
198,
6738,
42625,
14208,
1330,
1332,
198,
198,
6738,
2594,
13,
11321,
1330,
12747,
11,
49385,
355,
20613,
62,
31391,
198,
6738,
2594,
13,
11250,
3924,
13,
73,
81,
14751,
13,
46911,
11341,
1330,... | 2.049035 | 4,507 |
from graphene import relay, ObjectType
from graphene_django import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from .models import Colaborador
| [
6738,
42463,
1330,
24248,
11,
9515,
6030,
198,
6738,
42463,
62,
28241,
14208,
1330,
37770,
10267,
6030,
198,
6738,
42463,
62,
28241,
14208,
13,
24455,
1330,
37770,
22417,
32048,
15878,
198,
198,
6738,
764,
27530,
1330,
1623,
4820,
7079,
6... | 4.380952 | 42 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-29 19:15
from __future__ import unicode_literals
from django.db import migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
24,
13,
20,
319,
1584,
12,
3023,
12,
1959,
678,
25,
1314,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
19... | 2.672727 | 55 |
'''
Transforming extracted data for application of Zeilis et al.'s algorithm
Usage: python3 02_zeilis_01_extraction.py
'''
import os
import numpy as np
import pandas as pd
import constants
# Constants
NUMBER_OF_DIMENSIONS = constants.NUMBER_OF_DIMENSIONS
RESAMPLE_TIME_WINDOW = "M"
DIMENSION_NAMES = constants.DIMENSI... | [
7061,
6,
198,
8291,
15464,
21242,
1366,
329,
3586,
286,
9033,
346,
271,
2123,
435,
2637,
82,
11862,
198,
28350,
25,
21015,
18,
7816,
62,
2736,
346,
271,
62,
486,
62,
2302,
7861,
13,
9078,
198,
7061,
6,
198,
11748,
28686,
198,
198,
... | 2.621324 | 272 |
# -*- coding: utf-8 -*-
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib.auth.decorators import login_required
@login_required(login_url='/', redirect_field_name='')
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
42625,
14208,
13,
28243,
1330,
19390,
21947,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
62,
1462,
62,
26209,
198,
6738,
42625,
14208,
13,
3642,
822,... | 3.093333 | 75 |
#!/usr/bin/env python3
import sys
from aiida import load_profile
from aiida.plugins import DataFactory
from aiida.orm import Code
from aiida.engine import submit
from mpds_aiida.workflows.crystal import MPDSCrystalWorkchain
from mpds_aiida.common import get_template
load_profile()
calc_setup = get_template('productio... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
25064,
198,
6738,
257,
72,
3755,
1330,
3440,
62,
13317,
198,
6738,
257,
72,
3755,
13,
37390,
1330,
6060,
22810,
198,
6738,
257,
72,
3755,
13,
579,
1330,
6127,
198,
67... | 2.713626 | 433 |
"""Collect metrics about coverage of whole genome sequencing."""
import os
from plumbum import TEE
from resolwe.process import (
BooleanField,
Cmd,
DataField,
FileField,
GroupField,
IntegerField,
Process,
SchedulingClass,
StringField,
)
def replace_metrics_class(fname):
"""Re... | [
37811,
31337,
20731,
546,
5197,
286,
2187,
19270,
32841,
526,
15931,
198,
11748,
28686,
198,
198,
6738,
458,
2178,
388,
1330,
309,
6500,
198,
198,
6738,
581,
349,
732,
13,
14681,
1330,
357,
198,
220,
220,
220,
41146,
15878,
11,
198,
2... | 2.183432 | 2,873 |
"""
This script suppresses the 502 Bad Gateway messages, mitmproxy sends if the server is not responsing correctly.
For example, this functionality can be helpful if mitmproxy is used in between a web scanner and a web application.
Without this script, if the web application under test crashes, mitmproxy will send 502 ... | [
37811,
198,
1212,
4226,
802,
16746,
262,
47233,
7772,
29916,
6218,
11,
10255,
76,
36436,
12800,
611,
262,
4382,
318,
407,
2424,
278,
9380,
13,
198,
1890,
1672,
11,
428,
11244,
460,
307,
7613,
611,
10255,
76,
36436,
318,
973,
287,
1022... | 3.884444 | 225 |
from chokozainerrl.tools.make_video import check
from chokozainerrl.tools.make_video import growth
| [
6738,
442,
482,
8590,
391,
8056,
75,
13,
31391,
13,
15883,
62,
15588,
1330,
2198,
198,
6738,
442,
482,
8590,
391,
8056,
75,
13,
31391,
13,
15883,
62,
15588,
1330,
3349,
628
] | 3.125 | 32 |
# Copyright (c) 2019, NVIDIA CORPORATION.
# 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 i... | [
2,
15069,
357,
66,
8,
13130,
11,
15127,
23929,
44680,
6234,
13,
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,
... | 2.894737 | 779 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
* Copyright (C) 2017 Hendrik van Essen
*
* This file is subject to the terms and conditions of the MIT License
* See the file LICENSE in the top level directory for more details.
"""
from __future__ import absolute_import, print_function, unicode_literals
# REQUE... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
1635,
15069,
357,
34,
8,
2177,
14666,
12602,
5719,
11985,
268,
198,
1635,
198,
1635,
770,
2393,
318,
2426... | 2.820833 | 240 |
from core.entity.entity_exceptions import EntityFieldInvalid
class EntityField:
"""
Defines the default entity field.
The entity field is stored inside the Entity itself and contains rules how the user
can read the field value of a certain entity and write some value to the same field.
The Entit... | [
6738,
4755,
13,
26858,
13,
26858,
62,
1069,
11755,
1330,
20885,
15878,
44651,
628,
198,
4871,
20885,
15878,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2896,
1127,
262,
4277,
9312,
2214,
13,
628,
220,
220,
220,
383,
9312,
2214,... | 2.830723 | 1,660 |
from absl import app, flags, logging
import tfne
flags.DEFINE_integer('logging_level',
default=None, help='Integer parameter specifying the verbosity of the absl logging library')
flags.DEFINE_string('config_file',
default=None, help='String parameter specifying the file path ... | [
6738,
2352,
75,
1330,
598,
11,
9701,
11,
18931,
198,
198,
11748,
48700,
710,
198,
198,
33152,
13,
7206,
29940,
62,
41433,
10786,
6404,
2667,
62,
5715,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.629121 | 1,456 |
from ...utilities import db, moocdb_utils
from common import * | [
6738,
2644,
315,
2410,
1330,
20613,
11,
6941,
420,
9945,
62,
26791,
198,
6738,
2219,
1330,
1635
] | 3.647059 | 17 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | [
2,
16529,
23031,
198,
2,
399,
1713,
64,
19193,
329,
49452,
38589,
357,
45,
84,
47,
2149,
8,
198,
2,
15069,
357,
34,
8,
2211,
11,
399,
1713,
64,
11,
3457,
13,
220,
17486,
345,
423,
281,
4381,
198,
2,
351,
399,
1713,
64,
11,
345... | 2.323326 | 1,299 |
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QLabel
from PyQt5.QtGui import QFont
from PyQt5.QtCore import QTimer, QTime, Qt
app = QApplication(sys.argv)
demo = AppDemo()
demo.show()
app.exit(app.exec_()) | [
11748,
25064,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
1195,
23416,
11,
1195,
38300,
11,
1195,
53,
14253,
32517,
11,
1195,
33986,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72,
1330,
1195,
23252,
198,
673... | 2.428571 | 98 |
from files import *
from invoice_math import *
from invoice_doc import *
Files = InvoiceFiles()
Calculations = InvoiceMath()
Document = InvoiceDocument()
data = Files.get_audio_information()
Calculations.convert_times(data)
Calculations.add_costs(data)
for k, v in data.items():
print("File: {}\t Length: {}\t Cos... | [
6738,
3696,
1330,
1635,
198,
6738,
45458,
62,
11018,
1330,
1635,
198,
6738,
45458,
62,
15390,
1330,
1635,
198,
198,
25876,
796,
10001,
2942,
25876,
3419,
198,
9771,
3129,
602,
796,
10001,
2942,
37372,
3419,
198,
24941,
796,
10001,
2942,
... | 2.891156 | 147 |
from .random_player import *
| [
6738,
764,
25120,
62,
7829,
1330,
1635,
198
] | 3.625 | 8 |
# -*- coding: utf-8 -*-
"""
Testing of both scripts: :mod:`cardassembler` and :mod:`blueprint`.
.. note::
Run this script directly to run a :mod:`unittest`.
"""
import os
import re
import sys
import unittest
import xml.etree.ElementTree as ET
import pycodestyle
import blueprint
# Bypass internal Gimp's python ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
44154,
286,
1111,
14750,
25,
1058,
4666,
25,
63,
9517,
34455,
1754,
63,
290,
1058,
4666,
25,
63,
17585,
4798,
44646,
198,
198,
492,
3465,
3712,
198,
220,
2... | 2.770732 | 205 |
"""
This package provides the Python interface to functionality relating to
the Panda3D Runtime environment.
.. deprecated:: 1.10.0
The p3d packaging system has been replaced with the new setuptools-based
system. See the :ref:`distribution` manual section.
"""
| [
37811,
198,
1212,
5301,
3769,
262,
11361,
7071,
284,
11244,
11270,
284,
198,
1169,
41112,
18,
35,
43160,
2858,
13,
198,
198,
492,
39224,
3712,
352,
13,
940,
13,
15,
198,
220,
220,
383,
279,
18,
67,
16846,
1080,
468,
587,
6928,
351,
... | 3.788732 | 71 |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import os
import string
import tempfile
import zipfile
from indico.core.config import config
from indico.... | [
2,
770,
2393,
318,
636,
286,
1423,
3713,
13,
198,
2,
15069,
357,
34,
8,
6244,
532,
13130,
327,
28778,
198,
2,
198,
2,
1423,
3713,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
198,
2,
13096,
340,
739,
262,
2846,... | 3.423077 | 104 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
| [
2,
21004,
25,
3384,
69,
12,
23,
198,
11748,
4818,
8079,
198,
6738,
5366,
13,
9945,
1330,
20613,
198,
6738,
5366,
13,
85,
17,
1330,
10011,
2611,
44,
4254,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198
] | 3.263158 | 38 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
owner_users = {
'email': 'qa_test@binka.me',
'password': 'Password1-'
}
provider_users = {
'provider_user@binka.me': 'Password1-',
'provider1_user@binka.me': 'Password1-',
'supplier11@gmail.com': 'Kapital-Ist',
'supplier12@gmail.com': 'Kapital-... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
18403,
62,
18417,
796,
1391,
198,
220,
220,
220,
705,
12888,
10354,
705,
20402,
62,
9288,
31,
65,
48955,
13,
1326,
32... | 2.491156 | 1,470 |
"""
Copyright 2018 IBM Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ag... | [
37811,
201,
198,
220,
220,
15069,
2864,
19764,
10501,
201,
198,
201,
198,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
201,
198,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
1... | 2.248807 | 8,798 |
import pygame
class KEY:
"""
All the usefull keyboard intrupts
"""
backspace = pygame.K_BACKSPACE
tab = pygame.K_TAB
clear = pygame.K_CLEAR
return_ = pygame.K_RETURN
pause = pygame.K_PAUSE
escape = pygame.K_ESCA... | [
11748,
12972,
6057,
198,
4871,
35374,
25,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
1439,
262,
779,
12853,
10586,
493,
3622,
82,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
736,
13200,
796,
12972,
6057,
13,
42,
62,
31098,
43... | 1.456532 | 4,302 |
if __name__ == '__main__':
car = Car()
a_tire = ATire()
b_tire = BTire()
car.set_tire(a_tire)
for i in range(6):
car.run()
car.set_tire(b_tire)
car.run()
| [
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1097,
796,
1879,
3419,
198,
220,
220,
220,
257,
62,
83,
557,
796,
5161,
557,
3419,
198,
220,
220,
220,
275,
62,
83,
557,
796,
22205,
557,... | 1.798165 | 109 |
# TensorFlow and tf.keras
import tensorflow as tf #https://adventuresinmachinelearning.com/python-tensorflow-tutorial/
#import keras
from sklearn.model_selection import train_test_split
# Helper libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import time
#****************************... | [
2,
309,
22854,
37535,
290,
48700,
13,
6122,
292,
198,
11748,
11192,
273,
11125,
355,
48700,
220,
1303,
5450,
1378,
324,
10065,
259,
30243,
40684,
13,
785,
14,
29412,
12,
83,
22854,
11125,
12,
83,
44917,
14,
198,
2,
11748,
41927,
292,
... | 2.690265 | 565 |
import ipaddress
import warnings
from unittest import mock
from django.test import TestCase
from django_wireguard.models import WireguardInterface, WireguardPeer
from django_wireguard.wireguard import WireGuard, WireGuardException
| [
11748,
20966,
21975,
198,
11748,
14601,
198,
198,
6738,
555,
715,
395,
1330,
15290,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
42625,
14208,
62,
21809,
14864,
13,
27530,
1330,
14712,
14864,
39317,
11,
14712,
148... | 3.9 | 60 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
import tkinter as tk
from tkinter import ttk
if __name__ == '__main__':
root = tk.Tk()
root.title('Example')
ex = Example(root)
root.geometry("300x250+300+300")
root.mainloop()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
9800,
834,
796,
705,
541,
21879,
1077,
6,
628,
198,
11748,
256,
74,
3849,
355,
256,
74,
198,
6738,
25... | 2.227642 | 123 |
import pytest
from django.contrib.auth.models import User
from expenses.models import Expenses
from house.models import House
from scripts.create_mock_data import run
@pytest.mark.django_db()
| [
11748,
12972,
9288,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
198,
6738,
9307,
13,
27530,
1330,
5518,
4541,
198,
6738,
2156,
13,
27530,
1330,
2097,
198,
6738,
14750,
13,
17953,
62,
76,
735,
62,
78... | 3.362069 | 58 |
'''implements some basic number theory stuff: gcd, euler-phi function, inverts numbers modulo n.
'''
big_primes = 512927357,674506081
# use the division algorithm to find q,r given integers a,b. The
# quotient, q, and remainder, r, have the property that a = bq + r,
# 0<r<b
if __name__=="__main__":
run_tests()
| [
7061,
6,
320,
1154,
902,
617,
4096,
1271,
4583,
3404,
25,
308,
10210,
11,
304,
18173,
12,
34846,
2163,
11,
287,
24040,
3146,
953,
43348,
299,
13,
198,
198,
7061,
6,
198,
198,
14261,
62,
1050,
999,
796,
642,
18741,
1983,
27277,
11,
... | 2.735043 | 117 |
if __name__ == "__main__":
lst = [[1,10],[12,15],[18,20],[5,25]]
# lst2 = [[-5,5],[-5,5],[-5,5]]
lst = [[1,2],[2,3],[3,4],[1,3]]
print(solve(lst))
# print(solve(lst2)) | [
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
300,
301,
796,
16410,
16,
11,
940,
38430,
1065,
11,
1314,
38430,
1507,
11,
1238,
38430,
20,
11,
1495,
11907,
198,
220,
220,
220,
1303,
300,
301,
... | 1.720721 | 111 |
from airtrack.src.camera.base import AirtrackCamera
| [
6738,
1633,
11659,
13,
10677,
13,
25695,
13,
8692,
1330,
3701,
11659,
35632,
198
] | 3.714286 | 14 |
from unitmeasure import converters
from unitmeasure import dimension
from unitmeasure.util import classproperty
| [
6738,
4326,
1326,
5015,
1330,
6718,
1010,
198,
6738,
4326,
1326,
5015,
1330,
15793,
198,
198,
6738,
4326,
1326,
5015,
13,
22602,
1330,
1398,
26745,
628
] | 4.384615 | 26 |
import FWCore.ParameterSet.Config as cms
import copy
from ElectroWeakAnalysis.ZMuMu.zSelection_cfi import *
# same charge dimuons....
dimuonsGlobalSameCharge = cms.EDFilter(
"CandViewRefSelector",
### added UserData
src = cms.InputTag("userDataDimuons"),
##src = cms.InputTag("dimuons"),
cut = cms.... | [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
11748,
4866,
198,
198,
6738,
38781,
44898,
32750,
13,
57,
33239,
33239,
13,
89,
4653,
1564,
62,
66,
12463,
1330,
1635,
198,
198,
2,
976,
3877,
5391,
84,
684,
1106,
... | 2.42953 | 894 |
# -*- coding: utf-8 -*-
'''
BSD 3-Clause License
Copyright (c) 2021, Mike Bromberek
All rights reserved.
'''
# First party classes
# Third party classes
from flask import render_template, redirect, url_for, flash, request
from flask_login import current_user, login_user, logout_user, login_required
from werkzeug.url... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
198,
21800,
513,
12,
2601,
682,
13789,
198,
15269,
357,
66,
8,
33448,
11,
4995,
31455,
65,
18238,
198,
3237,
2489,
10395,
13,
198,
7061,
6,
198,
198,
2... | 2.833724 | 427 |
import numpy as np
import scipy as sp
import identify
from math import sqrt as _sqrt
from scipy.interpolate import CubicSpline as _CubicSpline
from os.path import splitext as _splitext
from interpolate import CSpline
from utils import C_hartree
__all__ = ['Hamiltonian']
class Hamiltonian:
"""Constructs the Hamil... | [
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
355,
599,
198,
11748,
5911,
198,
6738,
10688,
1330,
19862,
17034,
355,
4808,
31166,
17034,
198,
6738,
629,
541,
88,
13,
3849,
16104,
378,
1330,
7070,
291,
26568,
500,
355,
4808,
... | 2.109559 | 5,869 |
from django.urls import path
from . import views
urlpatterns = [
path('', views.ProjectView.as_view(), name='projects'),
path(r'<pk>/', views.ProjectDetailView.as_view(), name='project-detail'),
path(r'<pk>/tasks/', views.TaskProjectView.as_view(), name='project-tasks'),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
5009,
13,
16775,
7680,
13,
292,
62,
1177,
22784,
1438,
11639,
42068,
33809,
198... | 2.642202 | 109 |
from __future__ import unicode_literals
from django.db import models
from simple_history import register
from simple_history.models import HistoricalRecords
from simple_history.tests.custom_user.models import CustomUser
register(ExternalModelRegistered, app="simple_history.tests", manager_name="histories")
... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
6738,
2829,
62,
23569,
1330,
7881,
198,
6738,
2829,
62,
23569,
13,
27530,
1330,
23121,
6690,
3669,
198,
6738,
2829... | 3.668919 | 148 |
# project/server/models/user.py
import jwt
import datetime
from project.server import app, db, bcrypt
from .blacklistToken import BlacklistToken
from .favourite import Favourite
from .tmdb import Tmdb
from .show import Show
class User(db.Model):
""" User Model for storing user related details """
__tablenam... | [
2,
1628,
14,
15388,
14,
27530,
14,
7220,
13,
9078,
198,
198,
11748,
474,
46569,
198,
11748,
4818,
8079,
198,
198,
6738,
1628,
13,
15388,
1330,
598,
11,
20613,
11,
275,
29609,
198,
6738,
764,
13424,
4868,
30642,
1330,
2619,
4868,
30642... | 2.166062 | 1,379 |