content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
from .data import CovidData
import datetime as dt
from matplotlib.offsetbox import AnchoredText
import pandas as pd
import seaborn as sns
import geopandas as gpd
import matplotlib.pyplot as plt
plt.style.use('ggplot')
def pan_duration(date):
"""Return the duration in days of the pandemic.
As... | [
6738,
764,
7890,
1330,
39751,
312,
6601,
201,
198,
11748,
4818,
8079,
355,
288,
83,
201,
198,
6738,
2603,
29487,
8019,
13,
28968,
3524,
1330,
29253,
1850,
8206,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
384,
397,
121... | 2.090751 | 22,358 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
from contextlib import contextmanager
from System.Runtime.InteropServices import Marshal
#separte logger for comrelease to avoid spamming of log file
logger = logging.getLogger().getChild("comrelease")
logger.setLevel(logging.INFO) #... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
628,
198,
11748,
18931,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
198,
6738,
4482,
13,
41006,
13,
9492,
404,
31... | 2.879747 | 158 |
from pymongo import MongoClient
client = MongoClient('mongodb+srv://<username>:<password>@cluster0.27gwi.mongodb.net/Cluster0?retryWrites=true&w=majority')
username = ""
password = ""
url = f'mongodb+srv://{username}:{password}@cluster0.27gwi.mongodb.net/Cluster0?retryWrites=true&w=majority'
client = MongoClient(url)
... | [
6738,
279,
4948,
25162,
1330,
42591,
11792,
198,
198,
16366,
796,
42591,
11792,
10786,
31059,
375,
65,
10,
27891,
85,
1378,
27,
29460,
31175,
27,
28712,
29,
31,
565,
5819,
15,
13,
1983,
70,
37686,
13,
31059,
375,
65,
13,
3262,
14,
2... | 2.664384 | 146 |
"""
Blurring of images
===================
An example showing various processes that blur an image.
"""
import scipy.misc
from scipy import ndimage
import matplotlib.pyplot as plt
face = scipy.misc.face(gray=True)
blurred_face = ndimage.gaussian_filter(face, sigma=3)
very_blurred = ndimage.gaussian_filter(face, sigm... | [
37811,
198,
3629,
14924,
286,
4263,
198,
4770,
18604,
198,
198,
2025,
1672,
4478,
2972,
7767,
326,
23671,
281,
2939,
13,
198,
37811,
198,
198,
11748,
629,
541,
88,
13,
44374,
198,
6738,
629,
541,
88,
1330,
299,
67,
9060,
198,
11748,
... | 2.245509 | 334 |
#! /usr/bin/env python
import json
from optparse import OptionParser
usage = "usage: %prog [options] message"
parser = OptionParser(usage)
(options, args) = parser.parse_args()
if len(args) != 1:
parser.error("You must supply a label")
label = args[0]
try:
with open('pylintReport.json', 'r') as reportFile:... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
33918,
198,
198,
6738,
2172,
29572,
1330,
16018,
46677,
198,
198,
26060,
796,
366,
26060,
25,
4064,
1676,
70,
685,
25811,
60,
3275,
1,
198,
48610,
796,
16018,
46677,
7,
... | 2.132684 | 1,334 |
# -*- coding: utf-8 -*-
"""Unit test package for jinja_inflection."""
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
26453,
1332,
5301,
329,
474,
259,
6592,
62,
10745,
1564,
526,
15931,
198
] | 2.448276 | 29 |
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from cms.plugins.utils import downcast_plugins
from cms.models.placeholdermodel import Placeholder
from cms.models.pluginmodel import CMSPlugin
from smartsnippets_inherit.models import InheritPageContent
from smartsnippets_inherit.forms i... | [
6738,
269,
907,
13,
33803,
62,
8692,
1330,
40773,
37233,
14881,
198,
6738,
269,
907,
13,
33803,
62,
7742,
1330,
13877,
62,
7742,
198,
6738,
269,
907,
13,
37390,
13,
26791,
1330,
866,
2701,
62,
37390,
198,
6738,
269,
907,
13,
27530,
... | 3.592179 | 179 |
from django.conf import settings
from rest_framework.exceptions import ParseError
from rest_framework.parsers import BaseParser
import orjson
__all__ = ["ORJSONParser"]
| [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
1334,
62,
30604,
13,
1069,
11755,
1330,
2547,
325,
12331,
198,
6738,
1334,
62,
30604,
13,
79,
945,
364,
1330,
7308,
46677,
198,
198,
11748,
393,
17752,
628,
198,
834,
439,
834,
796... | 3.604167 | 48 |
from djangosanetesting.cases import TemplateTagTestCase
| [
6738,
42625,
648,
418,
272,
316,
37761,
13,
33964,
1330,
37350,
24835,
14402,
20448,
198
] | 3.733333 | 15 |
# An example WSGI for use with mod_wsgi, edit as necessary
# See http://mercurial.selenic.com/wiki/modwsgi for more information
# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "/path/to/repo/or/config"
# Uncomment and adjust if Mercurial is not installed system-wide
# (consult "installed module... | [
2,
1052,
1672,
25290,
18878,
329,
779,
351,
953,
62,
18504,
12397,
11,
4370,
355,
3306,
198,
2,
4091,
2638,
1378,
647,
22019,
498,
13,
741,
35866,
13,
785,
14,
15466,
14,
4666,
18504,
12397,
329,
517,
1321,
198,
198,
2,
10644,
284,
... | 3.207547 | 212 |
import os
from subprocess import run
import pyperclip
import webbrowser
from urllib import parse
location = 'production'
runOnSingleFolder('js')
runOnSingleFolder('css')
| [
11748,
28686,
198,
6738,
850,
14681,
1330,
1057,
198,
11748,
12972,
525,
15036,
198,
11748,
3992,
40259,
198,
6738,
2956,
297,
571,
1330,
21136,
198,
198,
24886,
796,
705,
25493,
6,
198,
198,
5143,
2202,
28008,
41092,
10786,
8457,
11537,
... | 3.510204 | 49 |
from .mscff_model import MSCFF
| [
6738,
764,
907,
66,
487,
62,
19849,
1330,
337,
6173,
5777,
198
] | 2.583333 | 12 |
from .InputLayerStructure import InputLayerStructure
from .LayerStructure import LayerStructure
| [
6738,
764,
20560,
49925,
1273,
5620,
1330,
23412,
49925,
1273,
5620,
198,
6738,
764,
49925,
1273,
5620,
1330,
34398,
1273,
5620,
198
] | 4.363636 | 22 |
from ursina import *
app = Ursina()
snake = Entity(model='cube', texture = 'assets\snake', scale=0.4, z=-1, collider='box')
ground = Entity(model='cube', texture='grass',rotation=(90,0,0),scale=(5,1,5), z=1)
apple = Entity(model='cube', texture='assets\\apple', scale=0.4, position=(1,-1,-1), collider='mesh')
body = [... | [
198,
6738,
220,
1834,
1437,
1330,
1635,
198,
1324,
796,
37935,
1437,
3419,
198,
198,
16184,
539,
796,
20885,
7,
19849,
11639,
40296,
3256,
11743,
796,
705,
19668,
59,
16184,
539,
3256,
5046,
28,
15,
13,
19,
11,
1976,
10779,
16,
11,
... | 2.678756 | 193 |
import json
from cp_request import Attribute, NamedEntity, Unit, Value
from cp_request.named_entity import NamedEntityEncoder, NamedEntityDecoder
| [
11748,
33918,
198,
198,
6738,
31396,
62,
25927,
1330,
3460,
4163,
11,
34441,
32398,
11,
11801,
11,
11052,
198,
6738,
31396,
62,
25927,
13,
13190,
62,
26858,
1330,
34441,
32398,
27195,
12342,
11,
34441,
32398,
10707,
12342,
628
] | 3.894737 | 38 |
import tensorflow as tf
from utils.decorators import shape_check
| [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
3384,
4487,
13,
12501,
273,
2024,
1330,
5485,
62,
9122,
628,
628
] | 3.4 | 20 |
# -*- coding: utf-8 -*-
'''
Created on 2015-08-21
@author: xhj
'''
import requests
import StringIO
import gzip
import threading
from loginer import Loginer
import time
from my_log import WeiboSearchLog
import os
import traceback
from bs4 import BeautifulSoup
import re
from Queue import Queue
import datetime
from st... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
198,
41972,
319,
1853,
12,
2919,
12,
2481,
198,
198,
31,
9800,
25,
2124,
71,
73,
198,
7061,
6,
198,
11748,
7007,
198,
11748,
10903,
9399,
198,
11748,
3... | 2.169078 | 1,106 |
from datetime import datetime, time
from enum import Enum
from typing import Optional, Sequence, Union
from pydantic import BaseModel
| [
6738,
4818,
8079,
1330,
4818,
8079,
11,
640,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
32233,
11,
45835,
11,
4479,
198,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
628,
198
] | 4.029412 | 34 |
##########################
####
# WARNING: THIS FILE IS DEPRECATED AND IS ONLY RETAINED FOR INFORMATIONAL PURPOSES
# ../dumb_topic_client is the up-to-date sample program
###
#########################
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import requests
... | [
14468,
7804,
2235,
198,
4242,
198,
2,
39410,
25,
12680,
45811,
3180,
5550,
47,
38827,
11617,
5357,
3180,
22224,
371,
20892,
1268,
1961,
7473,
3268,
21389,
29912,
33079,
37997,
1546,
198,
2,
11485,
14,
67,
2178,
62,
26652,
62,
16366,
318... | 3.030702 | 228 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Filename: DROP3.py
# @Author: Daniel Puente Ramrez
# @Time: 31/12/21 16:00
# @Version: 5.0
import copy
from sys import maxsize
import numpy as np
import pandas as pd
from sklearn.neighbors import NearestNeighbors
from .utils import transform
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
2488,
35063,
25,
220,
220,
220,
10560,
3185,
18,
13,
9078,
198,
2,
2488,
13838,
25,
220,
220,
220,
220,
220,
7806,
... | 2.484127 | 126 |
from django.apps import AppConfig
from orchestra.core import accounts, administration
from orchestra.core.translations import ModelTranslation
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
198,
198,
6738,
40095,
13,
7295,
1330,
5504,
11,
3662,
198,
6738,
40095,
13,
7295,
13,
7645,
49905,
1330,
9104,
48313,
628
] | 4.833333 | 30 |
import numpy as np
import matplotlib.pyplot as plt
x = np.random.rand(10, 10)
plt.imshow(x, cmap=plt.cm.hot)
#
plt.colorbar()
plt.savefig('imshow_demo.png')
| [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
201,
198,
87,
796,
45941,
13,
25120,
13,
25192,
7,
940,
11,
838,
8,
201,
198,
489,
83,
13,
320,
12860,
7,
87,
11,
269,
8... | 1.965517 | 87 |
# This test code was written by the `hypothesis.extra.ghostwriter` module
# and is provided under the Creative Commons Zero public domain dedication.
from pathlib import Path
from hypothesis import given, strategies as st
import attack_surface_pypy.core.exceptions
| [
2,
770,
1332,
2438,
373,
3194,
416,
262,
4600,
36362,
313,
8497,
13,
26086,
13,
38933,
16002,
63,
8265,
198,
2,
290,
318,
2810,
739,
262,
17404,
13815,
12169,
1171,
7386,
22445,
13,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
... | 4.044776 | 67 |
#! /usr/bin/python3
from Crypto.Cipher import AES
from random import randint
# https://www.cryptopals.com/sets/4/challenges/27
# Recover the key from CBC with IV=Key
import sys
sys.path.append('..')
from cryptopals import ctr,xor,random_aes_key,cbc_decrypt,cbc_encrypt
main()
| [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
18,
198,
198,
6738,
36579,
13,
34,
10803,
1330,
34329,
198,
198,
6738,
4738,
1330,
43720,
600,
198,
198,
2,
3740,
1378,
2503,
13,
29609,
404,
874,
13,
785,
14,
28709,
14,
19,
14,
36747,
3412... | 2.660377 | 106 |
import os
import sys
DIRNAME = os.path.abspath(os.path.dirname(__file__))
rel = lambda *x: os.path.abspath(os.path.join(DIRNAME, *x))
PROJECT_DIR = rel('..')
activate_this = rel('env', 'bin', 'activate_this.py')
# Activate virtualenv
execfile(activate_this, {'__file__': activate_this})
os.environ['DJANGO_SETTINGS_... | [
11748,
28686,
198,
11748,
25064,
628,
198,
34720,
20608,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
4008,
198,
2411,
796,
37456,
1635,
87,
25,
28686,
13,
6978,
13,
397,
2777,
776,... | 2.646789 | 218 |
"""Functions for generating random data with injected relationships"""
from itertools import product
import os
import json
import re
import random
import numpy as np
from numpy import random as rd
from scipy.special import comb
from ntp.util.util_kb import load_from_list
def gen_relationships(n_pred, n_rel, body_... | [
37811,
24629,
2733,
329,
15453,
4738,
1366,
351,
25077,
6958,
37811,
198,
198,
6738,
340,
861,
10141,
1330,
1720,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
302,
198,
11748,
4738,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,... | 2.626806 | 2,977 |
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from accounts.models import Account
from accounts.serializers import AccountSerializer
from .utils import create_accounts
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
3486,
2043,
395,
20448,
198,
198,
6738,
5504,
13,
27530,
1330,
10781,
198,
6738,
5504,
13,
46911,
11341,
... | 4.196429 | 56 |
#!/usr/bin/python3
FILE_PATH = "./littleschoolbus.bmp"
with open(FILE_PATH,"rb") as f:
bytes = bytearray(f.read())
result = ""
for byte in bytes[54:]:
result += str(byte & 1)
print(result)
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
25664,
62,
34219,
796,
366,
19571,
75,
715,
829,
1251,
10885,
13,
65,
3149,
1,
198,
198,
4480,
1280,
7,
25664,
62,
34219,
553,
26145,
4943,
355,
277,
25,
198,
220,
220,
220,
9881... | 2.295455 | 88 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-16 15:26
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,
940,
13,
19,
319,
2177,
12,
486,
12,
1433,
1315,
25,
2075,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.690909 | 55 |
import numpy
import os
import json
import cv2
import csv
import os.path as osp
import mmcv
import numpy as np
if __name__ == '__main__':
import fire
fire.Fire()
#img_prefix = '/home/share2/VisDrone2019/TASK1/VisDrone2019-DET-val/'
#img_writen= '/home/share2/VisDrone2019/TAS... | [
11748,
299,
32152,
201,
198,
11748,
28686,
201,
198,
11748,
33918,
201,
198,
11748,
269,
85,
17,
201,
198,
11748,
269,
21370,
201,
198,
11748,
28686,
13,
6978,
355,
267,
2777,
201,
198,
11748,
8085,
33967,
201,
198,
11748,
299,
32152,
... | 2.133005 | 203 |
#!/usr/bin/env python3
# Copyleft 2021 Sidon Duarte
#
import http
import sys
from typing import Any
import colorama
import requests
from rabbitgetapi import cli
from rabbitgetapi import exceptions
from rabbitgetapi import build_parser
if __name__ == "__main__":
sys.exit(main())
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
6955,
2349,
701,
33448,
15686,
261,
10343,
32074,
198,
2,
198,
11748,
2638,
198,
11748,
25064,
198,
6738,
19720,
1330,
4377,
198,
198,
11748,
3124,
1689,
198,
11748,
7007,
198,
... | 3.247191 | 89 |
from typing import Union, Iterable
import hashlib
def hash_id(seeds:Union[str, Iterable], n:int=32)->str:
"""For the moment, use the default simple python hash func
"""
h = hashlib.sha256(''.join(seeds)).hexdigest()[:n]
return h | [
6738,
19720,
1330,
4479,
11,
40806,
540,
198,
11748,
12234,
8019,
198,
198,
4299,
12234,
62,
312,
7,
325,
5379,
25,
38176,
58,
2536,
11,
40806,
540,
4357,
299,
25,
600,
28,
2624,
8,
3784,
2536,
25,
198,
220,
220,
220,
37227,
1890,
... | 2.722222 | 90 |
import os
import numpy as np
import torch
from torch.utils.data import Dataset
import math
import torch
import torch.nn.functional as F
import random
import torchvision.datasets
from torchvision.transforms import *
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
from PIL import Imag... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
316,
198,
11748,
10688,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
4738,
... | 3.147959 | 196 |
print(lambda x: x*x (10))
# may give address of lambda function | [
4798,
7,
50033,
2124,
25,
2124,
9,
87,
357,
940,
4008,
201,
198,
201,
198,
2,
743,
1577,
2209,
286,
37456,
2163,
220
] | 2.913043 | 23 |
from app import crud
from app.db.database import get_default_bucket
from app.models.config import ITEM_DOC_TYPE
from app.models.item import ItemCreate, ItemUpdate
from app.tests.utils.user import create_random_user
from app.tests.utils.utils import random_lower_string
| [
6738,
598,
1330,
1067,
463,
198,
6738,
598,
13,
9945,
13,
48806,
1330,
651,
62,
12286,
62,
27041,
316,
198,
6738,
598,
13,
27530,
13,
11250,
1330,
7283,
3620,
62,
38715,
62,
25216,
198,
6738,
598,
13,
27530,
13,
9186,
1330,
9097,
16... | 3.455696 | 79 |
MODEL_PATH = "./model/model.pt"
| [
33365,
3698,
62,
34219,
796,
366,
19571,
19849,
14,
19849,
13,
457,
1,
198
] | 2.285714 | 14 |
##**************************************************************************************##
## Step1. Load Packages and Input Data ##
##**************************************************************************************##
import pandas as pd
import nu... | [
201,
198,
2235,
17174,
17174,
8412,
2466,
1174,
2235,
201,
198,
2235,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5012,
16,
13,
8778,
6400,
1095,
290,
23412,
6060,
220,
220,
... | 2.233378 | 5,189 |
name = "testspeed"
from time import time
from sys import argv
from os import system
tic = time()
system('python %s' % (argv[1]))
toc = time()
print('used %s seconds' % (toc - tic))
| [
3672,
796,
366,
41989,
39492,
1,
201,
198,
6738,
640,
1330,
640,
201,
198,
6738,
25064,
1330,
1822,
85,
201,
198,
6738,
28686,
1330,
1080,
201,
198,
13370,
796,
640,
3419,
201,
198,
10057,
10786,
29412,
4064,
82,
6,
4064,
357,
853,
... | 2.661972 | 71 |
from osgeo import ogr
from typing import List, Union
import math
import os
import warnings
import numpy as np
from gdalhelpers.checks import values_checks, datasource_checks, layer_checks
from gdalhelpers.helpers import layer_helpers, datasource_helpers, geometry_helpers
def create_points_at_angles_distance_in_direct... | [
6738,
28686,
469,
78,
1330,
267,
2164,
198,
6738,
19720,
1330,
7343,
11,
4479,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
14601,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
308,
31748,
16794,
364,
13,
42116,
1330,
3815,
62,
42... | 2.210422 | 3,013 |
import unittest
from rotor_tests import *
from rotor_settings_tests import *
from reflector_tests import *
from enigma_tests import *
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
44883,
62,
41989,
1330,
1635,
198,
6738,
44883,
62,
33692,
62,
41989,
1330,
1635,
198,
6738,
4079,
273,
62,
41989,
1330,
1635,
198,
6738,
551,
13495,
62,
41989,
1330,
1635,
198,
198,
403,
715,
395,
13,... | 3.355556 | 45 |
from werkzeug import find_modules, import_string
from forums import routes
from forums.modifications import modify_core
modify_core()
| [
6738,
266,
9587,
2736,
1018,
1330,
1064,
62,
18170,
11,
1330,
62,
8841,
198,
198,
6738,
14216,
1330,
11926,
198,
6738,
14216,
13,
4666,
6637,
1330,
13096,
62,
7295,
628,
198,
198,
4666,
1958,
62,
7295,
3419,
198
] | 3.631579 | 38 |
"""Routes related to ingesting data from the robot"""
import os
import logging
from pathlib import Path
from flask import Blueprint, request, current_app
from pydantic import ValidationError
from werkzeug.utils import secure_filename
from polybot.models import UVVisExperiment
logger = logging.getLogger(__name__)
b... | [
37811,
49,
448,
274,
3519,
284,
26151,
278,
1366,
422,
262,
9379,
37811,
198,
198,
11748,
28686,
198,
11748,
18931,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
42903,
1330,
39932,
11,
2581,
11,
1459,
62,
1324,
198,
6738,
279,
... | 3.523364 | 107 |
#dependency Module
if __name__ == '__main__':
injector = Injector(AppModule())
logic = injector.get(BusinessLogic)
logic.do_stuff() | [
2,
45841,
1387,
19937,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
8677,
273,
796,
554,
752,
273,
7,
4677,
26796,
28955,
628,
220,
220,
220,
9156,
796,
8677,
273,
13,
1136,
7,
24749,
11187... | 2.636364 | 55 |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | [
2,
16529,
32501,
198,
2,
15069,
357,
66,
8,
1946,
438,
11,
383,
21924,
5350,
7712,
4816,
13,
198,
2,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
347,
10305,
513,
12,
565,
682,
13789,
13,
198,
2,
198,
2,
383,
1336,
5964,
318,
... | 5.347222 | 72 |
# This file is part of beets.
# Copyright 2015
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, pu... | [
2,
770,
2393,
318,
636,
286,
307,
1039,
13,
198,
2,
15069,
1853,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
198,
2,
257,
4866,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
... | 3.64794 | 267 |
import tools.libtcod.libtcodpy as libtcod
| [
11748,
4899,
13,
8019,
83,
19815,
13,
8019,
83,
19815,
9078,
355,
9195,
83,
19815,
198
] | 2.625 | 16 |
# MINLP written by GAMS Convert at 04/21/18 13:54:11
#
# Equation counts
# Total E G L N X C B
# 497 61 388 48 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | [
2,
220,
20625,
19930,
3194,
416,
402,
40834,
38240,
379,
8702,
14,
2481,
14,
1507,
1511,
25,
4051,
25,
1157,
198,
2,
220,
220,
198,
2,
220,
7889,
341,
9853,
198,
2,
220,
220,
220,
220,
220,
7472,
220,
220,
220,
220,
220,
220,
22... | 1.94554 | 25,156 |
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | [
2,
19617,
28,
40477,
23,
198,
198,
2,
15069,
2864,
28591,
5097,
2606,
35,
13,
9858,
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,
... | 3.73743 | 179 |
from rest_framework import status
from django.urls import reverse
from authors.apps.articles.models import Article
from authors.base_test_config import TestConfiguration
slug = None
| [
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
198,
6738,
7035,
13,
18211,
13,
26845,
13,
27530,
1330,
10172,
198,
6738,
7035,
13,
8692,
62,
9288,
62,
11250,
1330,
6208,
38149,
198,
198,
664... | 3.86 | 50 |
# ------------------------------------------------------------
# Training script example for Keras implementation
#
# Kaisar Kushibar (2019)
# kaisar.kushibar@udg.edu
# ------------------------------------------------------------
import os
import sys
import numpy as np
from functools import partial
from tkinter import... | [
2,
20368,
1783,
10541,
198,
2,
13614,
4226,
1672,
329,
17337,
292,
7822,
198,
2,
220,
198,
2,
11611,
271,
283,
18995,
571,
283,
357,
23344,
8,
198,
2,
479,
15152,
283,
13,
74,
1530,
571,
283,
31,
463,
70,
13,
15532,
198,
2,
2036... | 3.349091 | 275 |
"""
=======================
Yahoo Finance source
=======================
"""
import re
import requests
import time
from json import loads
from bs4 import BeautifulSoup
from yahoofinancials import YahooFinancials
# Yahoo Finance data source
# Private method to get time interval code
def _build_historical_di... | [
37811,
198,
4770,
1421,
18604,
198,
56,
12992,
15007,
2723,
198,
4770,
1421,
18604,
198,
37811,
198,
198,
11748,
302,
198,
11748,
7007,
198,
11748,
640,
198,
6738,
33918,
1330,
15989,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,... | 2.964286 | 280 |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
2896,
500,
994,
262,
4981,
329,
534,
15881,
276,
3709,
198,
2,
198,
2,
4091,
10314,
287,
25,
198,
2,
2638,
1378,
15390,
13,
1416,
2416,
88,
13,
2398,
14,
2... | 2.590909 | 66 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 12 10:02:58 2020
@author: Xavier Jimenez
"""
#------------------------------------------------------------------#
# # # # # Imports # # # # #
#------------------------------------------------------------------#
import numpy as np
import os
import ... | [
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,
198,
41972,
319,
26223,
5267,
1105,
838,
25,
2999,
25,
3365,
12131,
198,
198,
31,
9800,
25,
30825,
5395,
1... | 2.070245 | 12,798 |
#!/usr/bin/env python
import betterwin
G=betterwin.confcfg.load_global_config()
if __name__ == '__main__':
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
1365,
5404,
198,
198,
38,
28,
27903,
5404,
13,
10414,
37581,
13,
2220,
62,
20541,
62,
11250,
3419,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198
] | 2.658537 | 41 |
import torch.nn as nn
import torch
import torch.nn.functional as F
import absl.flags as flags
from absl import app
FLAGS = flags.FLAGS
# Point_center encode the segmented point cloud
# one more conv layer compared to original paper
if __name__ == "__main__":
app.run(main)
| [
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
2352,
75,
13,
33152,
355,
9701,
198,
6738,
2352,
75,
1330,
598,
198,
198,
38948,
50,
796,
9701,
13,
38948,
50,
... | 3.193182 | 88 |
from greenflow.dataframe_flow import Node
from greenflow.dataframe_flow.portsSpecSchema import (ConfSchema,
PortsSpecSchema)
from greenflow.dataframe_flow.metaSpec import MetaDataSchema
from greenflow.dataframe_flow.util import get_file_path
from greenflow.dataframe... | [
6738,
4077,
11125,
13,
7890,
14535,
62,
11125,
1330,
19081,
198,
6738,
4077,
11125,
13,
7890,
14535,
62,
11125,
13,
3742,
22882,
27054,
2611,
1330,
357,
18546,
27054,
2611,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 2.602484 | 161 |
import mandelbrot as mand
from PIL import Image
width = 1280
height = 720
scale = 2
if __name__ == "__main__":
main()
| [
11748,
6855,
417,
7957,
83,
355,
6855,
198,
6738,
350,
4146,
1330,
7412,
198,
198,
10394,
796,
37674,
198,
17015,
796,
26250,
198,
198,
9888,
796,
362,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
... | 2.73913 | 46 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn.utils.weight_init import trunc_normal_
#adapted from open-mmlab implementation of swin transformer
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
8085,
33967,
13,
66,
20471,
13,
26791,
13,
6551,
62,
15003,
1330,
40122,
62,
11265,
62,
198,
198,
2,
42552,
276,
... | 3.415094 | 53 |
#Import some stuff
import os
import zipfile
import ConfigParser
import string
import argparse
from xml.etree.ElementTree import ElementTree
from constants import SHORT_NAME, VERSION_NUMBER, FULL_NAME, GEOGEBRA_XML_LOCATION
from diagram import AsyDiagram, doCompileDiagramObjects, drawDiagram
# Argument parser {{{
pars... | [
2,
20939,
617,
3404,
198,
11748,
28686,
198,
11748,
19974,
7753,
198,
11748,
17056,
46677,
198,
11748,
4731,
198,
11748,
1822,
29572,
198,
198,
6738,
35555,
13,
316,
631,
13,
20180,
27660,
1330,
11703,
27660,
198,
6738,
38491,
1330,
6006,... | 2.640401 | 2,297 |
import torch
from utils import get_teacher1, get_teacher2, get_student
def collect_model(args, data_info_s, data_info_t1, data_info_t2):
"""This is the function that constructs the dictionary containing the models and the corresponding optimizers
Args:
args (parse_args): parser arguments
data... | [
11748,
28034,
198,
6738,
3384,
4487,
1330,
651,
62,
660,
3493,
16,
11,
651,
62,
660,
3493,
17,
11,
651,
62,
50139,
628,
198,
4299,
2824,
62,
19849,
7,
22046,
11,
1366,
62,
10951,
62,
82,
11,
1366,
62,
10951,
62,
83,
16,
11,
1366... | 2.66563 | 643 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
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,
628
] | 2.977273 | 44 |
r"""
===================================================
ConeCyl (:mod:`desicos.abaqus.conecyl`)
===================================================
.. currentmodule:: desicos.abaqus.conecyl
Cone/Cylinder Model
=====================
Figure 1 provides a schematic view of the typical model created using this
module. T... | [
81,
37811,
198,
10052,
4770,
18604,
198,
34,
505,
34,
2645,
357,
25,
4666,
25,
63,
8906,
291,
418,
13,
15498,
45260,
13,
49180,
38801,
63,
8,
198,
10052,
4770,
18604,
198,
198,
492,
1459,
21412,
3712,
748,
291,
418,
13,
15498,
45260... | 2.655698 | 1,246 |
r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, \
r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, \
r23, r24, r25, r26, r27, r28, r29, r30, r31 = map(_R, range(32))
fr0, fr1, fr2, fr3, fr4, fr5, fr6, fr7, fr8, fr9, fr10, fr11, fr12, \
fr13, fr14, fr15, fr16, fr17, fr18, fr19, fr20, fr21, fr22, \... | [
198,
81,
15,
11,
374,
16,
11,
374,
17,
11,
374,
18,
11,
374,
19,
11,
374,
20,
11,
374,
21,
11,
374,
22,
11,
374,
23,
11,
374,
24,
11,
374,
940,
11,
374,
1157,
11,
374,
1065,
11,
3467,
198,
220,
220,
220,
374,
1485,
11,
3... | 1.567901 | 567 |
"""Problem 9: Special Pythagorean triplet.
Brute force."""
import unittest
def find_triple(s):
"""Returns abc where a^2+b^2=c^2 with a+b+c=s."""
a, b, c = 998, 1, 1
while b < 999:
if a**2 + b**2 == c**2:
return a*b*c
if a == 1:
c += 1
b = 1
a... | [
37811,
40781,
860,
25,
6093,
48657,
363,
29456,
15055,
83,
13,
198,
198,
9414,
1133,
2700,
526,
15931,
198,
11748,
555,
715,
395,
198,
198,
4299,
1064,
62,
28461,
1154,
7,
82,
2599,
198,
220,
220,
220,
37227,
35561,
450,
66,
810,
25... | 1.745098 | 255 |
import uuid
import datetime
import utilities.file_utilities as file_utilities
EBXML_TIMESTAMP_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
def get_uuid():
"""Generate a UUID suitable for sending in messages to Spine.
:return: A string representation of the UUID.
"""
return str(uuid.uuid4()).upper()
def get_times... | [
11748,
334,
27112,
198,
11748,
4818,
8079,
198,
11748,
20081,
13,
7753,
62,
315,
2410,
355,
2393,
62,
315,
2410,
198,
198,
30195,
55,
5805,
62,
51,
3955,
6465,
23518,
62,
21389,
1404,
796,
36521,
56,
12,
4,
76,
12,
4,
67,
51,
4,
... | 2.741784 | 213 |
from test_couch import *
from test_toggle import *
from test_quickcache import *
| [
6738,
1332,
62,
66,
7673,
1330,
1635,
198,
6738,
1332,
62,
44256,
1330,
1635,
198,
6738,
1332,
62,
24209,
23870,
1330,
1635,
198
] | 3.521739 | 23 |
import sqlite3
from helpers import get_db_path, get_timeframes
from traceback import print_tb
timeframes = get_timeframes()
print(timeframes)
for timeframe in timeframes:
with sqlite3.connect(get_db_path(timeframe)) as connection:
try:
c = connection.cursor()
print("Cleanin up!"... | [
11748,
44161,
578,
18,
198,
198,
6738,
49385,
1330,
651,
62,
9945,
62,
6978,
11,
651,
62,
2435,
37805,
198,
6738,
12854,
1891,
1330,
3601,
62,
83,
65,
198,
198,
2435,
37805,
796,
651,
62,
2435,
37805,
3419,
198,
198,
4798,
7,
2435,
... | 2.141631 | 466 |
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
import seaborn as sns
import pandas as pd
import glob
import re
from itertools import combinations
import matplotlib
matplotlib.rcParams['text.usetex'] = True
| [
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
1330,
50000,
43106,
198,
198,
11748,
384,
397,
1211,
355,
3013,
82... | 3.229885 | 87 |
from os.path import join, exists, isdir, relpath, abspath, dirname
import datetime as dt
import posixpath
import logging
import tempfile
from os import stat, makedirs, remove
import random
import uuid
from cStringIO import StringIO
import time
from six import string_types
try:
import gevent
except:
gevent = No... | [
6738,
28686,
13,
6978,
1330,
4654,
11,
7160,
11,
318,
15908,
11,
823,
6978,
11,
2352,
6978,
11,
26672,
3672,
198,
11748,
4818,
8079,
355,
288,
83,
198,
11748,
1426,
844,
6978,
198,
11748,
18931,
198,
11748,
20218,
7753,
198,
6738,
286... | 3.346154 | 182 |
# Generated by Django 2.0.3 on 2018-04-06 18:37
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
18,
319,
2864,
12,
3023,
12,
3312,
1248,
25,
2718,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
142... | 3.019231 | 52 |
from generate import generate
from datetime import datetime
from time import sleep
# sorting algorithms
# merge_sort helper functions
def split(full_list):
'''
get length of list
initialize both halves
'''
list_len = len(full_list)
left_half, right_half = list(), list()
'''
itera... | [
6738,
7716,
1330,
7716,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
640,
1330,
3993,
628,
198,
2,
29407,
16113,
628,
628,
198,
2,
20121,
62,
30619,
31904,
5499,
198,
198,
4299,
6626,
7,
12853,
62,
4868,
2599,
198,
220,
220,
... | 2.610236 | 254 |
#!/usr/bin/env python
# coding=utf-8
import web
import lib.user as user
"""[done]"""
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
28,
40477,
12,
23,
198,
11748,
3992,
198,
11748,
9195,
13,
7220,
355,
2836,
198,
15931,
17912,
28060,
60,
37811,
198
] | 2.65625 | 32 |
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import logging
import math
import os
import sys
from io import open
import numpy as np
import torch
from torch import nn
from torch.nn import CrossEntropyLoss, MSELoss
from pytorch_transformers import WEIGHTS_NAME, CONFIG_N... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
33245,
1330,
1280,
... | 2.696691 | 544 |
from setuptools import setup
__version__ = '0.0.3'
REQUIRES = ['psycopg2-binary']
EXTRAS_REQUIRE = {
'sqlalchemy': ['sqlalchemy'],
'jinjasql': ['jinjasql'],
'pandas': ['jinjasql', 'pandas'],
}
extras_lists = [vals for k, vals in EXTRAS_REQUIRE.items()]
# flattening the values in EXTRAS_REQUIRE from popula... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
834,
9641,
834,
796,
705,
15,
13,
15,
13,
18,
6,
198,
198,
2200,
10917,
4663,
1546,
796,
37250,
13764,
22163,
70,
17,
12,
39491,
20520,
198,
6369,
5446,
1921,
62,
2200,
49128,
796,
1391... | 2.143382 | 544 |
"""
Figurenerkennung for German literary texts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`figur` is very easy to use:
```
>>> import figur
>>> text = "Der Grtner entfernte sich eilig, und Eduard folgte bald."
>>> figur.tag(text)
SentenceId Token Tag
0 0 Der _
1 0 Grt... | [
37811,
198,
11337,
1008,
74,
1697,
2150,
329,
2679,
16716,
13399,
198,
27156,
27156,
15116,
4907,
198,
198,
63,
5647,
333,
63,
318,
845,
2562,
284,
779,
25,
198,
198,
15506,
63,
198,
33409,
1330,
31474,
198,
33409,
2420,
796,
366,
285... | 1.736994 | 346 |
import cv2
import numpy as np
import os
inputpath = 'folder path'
outpath = 'video file path/video.mp4'
fps = 29
frames_to_video(inputpath,outpath,fps)
| [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
628,
198,
15414,
6978,
796,
705,
43551,
3108,
6,
198,
448,
6978,
796,
220,
705,
15588,
2393,
3108,
14,
15588,
13,
3149,
19,
6,
198,
29647,
796,
2808,
198,
37... | 2.719298 | 57 |
import tensorflow as tf
import numpy as np
import traceback
import os.path
from .worker import Worker
from .param import *
from .params import *
import logging
logger = logging.getLogger(__name__)
def resize_and_load(var, val, sess):
o_shape = var.get_shape().as_list()
i_shape = list(val.shape)
if o_sh... | [
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
12854,
1891,
198,
11748,
28686,
13,
6978,
198,
198,
6738,
764,
28816,
1330,
35412,
198,
6738,
764,
17143,
1330,
1635,
198,
6738,
764,
37266,
... | 2.446429 | 280 |
import os
import glob
import yaml
import torch
import argparse
from addict import Dict
from dataset import *
from init import *
from utilities import *
from train import *
if __name__ == '__main__':
args = parse_args()
main(args) | [
11748,
28686,
198,
11748,
15095,
198,
11748,
331,
43695,
198,
11748,
28034,
198,
11748,
1822,
29572,
198,
6738,
19678,
1330,
360,
713,
198,
6738,
27039,
1330,
1635,
198,
6738,
2315,
1330,
1635,
198,
6738,
20081,
1330,
1635,
198,
6738,
451... | 3.287671 | 73 |
"""acceptance tests"""
import unittest
from nose.plugins.attrib import attr
| [
37811,
13635,
590,
5254,
37811,
198,
198,
11748,
555,
715,
395,
198,
198,
6738,
9686,
13,
37390,
13,
1078,
822,
1330,
708,
81,
628
] | 3.291667 | 24 |
#!/usr/bin/env python3
# Copyright (c) 2019 The Bitcoin SV developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_f... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
66,
8,
13130,
383,
6185,
20546,
6505,
198,
2,
4307,
6169,
739,
262,
17168,
3788,
5964,
11,
766,
262,
19249,
198,
2,
2393,
27975,
45761,
393,
2638,
1378,
2503,
13,
... | 3.478571 | 140 |
# Generated by Django 2.1.8 on 2020-01-08 07:55
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
23,
319,
12131,
12,
486,
12,
2919,
8753,
25,
2816,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import gym
import numpy as np
import tensorflow as tf
import time
from actor_critic.policy import A2CBuilder
from actor_critic.util import discount_with_dones, cat_entropy, fix_tf_name
from common.model import NetworkBase
from common.multiprocessing_env import SubprocVecEnv
from tqdm import tqdm
# The function tha... | [
198,
11748,
11550,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
640,
198,
198,
6738,
8674,
62,
22213,
291,
13,
30586,
1330,
317,
17,
34,
32875,
220,
198,
6738,
8674,
62,
22213,
291,
13,
22... | 1.859921 | 3,034 |
from enum import Enum
import hashlib
import math
import os
import random
import re
from chainmap import ChainMap
from torch.autograd import Variable
import librosa
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as data
from .manage_audio import AudioPrepr... | [
6738,
33829,
1330,
2039,
388,
198,
11748,
12234,
8019,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
302,
198,
198,
6738,
6333,
8899,
1330,
21853,
13912,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
11748... | 2.09187 | 2,743 |
import json
import os
import arrow
import libvirt
import pytest
from virt_backup.backups import DomBackup
from virt_backup.domains import get_xml_block_of_disk
from virt_backup.backups.snapshot import DomExtSnapshot, DomExtSnapshotCallbackRegistrer
from virt_backup.exceptions import DiskNotFoundError, SnapshotNotStart... | [
11748,
33918,
198,
11748,
28686,
198,
11748,
15452,
198,
11748,
9195,
48940,
198,
11748,
12972,
9288,
198,
198,
6738,
4118,
62,
1891,
929,
13,
1891,
4739,
1330,
9666,
7282,
929,
198,
6738,
4118,
62,
1891,
929,
13,
3438,
1299,
1330,
651,... | 3.407407 | 108 |
import re
from . import base
| [
11748,
302,
198,
6738,
764,
1330,
2779,
198
] | 3.625 | 8 |
__version__ = "2.4.3"
from . import errors
from .client import Client
from .interpreter import Interpreter
from .time import Time
from .formatters import format_property, format_decision_rules
from .reducer import reduce_decision_rules
from .tree_utils import (
extract_decision_paths_from_tree,
extract_decisio... | [
834,
9641,
834,
796,
366,
17,
13,
19,
13,
18,
1,
198,
198,
6738,
764,
1330,
8563,
198,
6738,
764,
16366,
1330,
20985,
198,
6738,
764,
3849,
3866,
353,
1330,
4225,
3866,
353,
198,
6738,
764,
2435,
1330,
3862,
198,
6738,
764,
18982,
... | 2.845912 | 318 |
# -*- coding: utf-8 -*-
from .instance import BlockchainInstance
from ..block import Block as SyncBlock, BlockHeader as SyncBlockHeader
from graphenecommon.aio.block import (
Block as GrapheneBlock,
BlockHeader as GrapheneBlockHeader,
)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
764,
39098,
1330,
29724,
33384,
198,
6738,
11485,
9967,
1330,
9726,
355,
35908,
12235,
11,
9726,
39681,
355,
35908,
12235,
39681,
198,
6738,
42463,
11321,
13,
64,
95... | 3.293333 | 75 |
# NxN , ,
# (for) . matrix stop.
#
n, k = map(int, input().split())
matrix = []
for _ in range(n):
matrix.append(list(map(int, input().split())))
s, x, y = map(int, input().split())
#
dx = [-1, 1, 0, 0] #
dy = [0, 0, -1, 1] #
# dict. initial
virus = {}
for i in range(k):
virus[i+... | [
2,
399,
87,
45,
837,
220,
220,
220,
220,
837,
220,
220,
220,
220,
198,
2,
357,
1640,
8,
220,
220,
220,
764,
220,
220,
17593,
220,
220,
2245,
13,
198,
2,
220,
220,
220,
220,
198,
198,
77,
11,
479,
796,
3975,
7,
600,
11,
5128,... | 1.930818 | 318 |
"""
Internationalization tasks
"""
import re
import subprocess
import sys
from path import Path as path
from paver.easy import cmdopts, needs, sh, task
from .utils.cmd import django_cmd
from .utils.envs import Env
from .utils.timer import timed
try:
from pygments.console import colorize
except ImportError:
... | [
37811,
198,
24274,
1634,
8861,
198,
37811,
628,
198,
11748,
302,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
198,
6738,
3108,
1330,
10644,
355,
3108,
198,
6738,
279,
8770,
13,
38171,
1330,
23991,
404,
912,
11,
2476,
11,
427,
11,
4... | 2.639944 | 711 |
import sympy.physics.mechanics as _me
import sympy as _sm
import math as m
import numpy as _np
frame_n = _me.ReferenceFrame('n')
frame_a = _me.ReferenceFrame('a')
a = 0
d = _me.inertia(frame_a, 1, 1, 1)
point_po1 = _me.Point('po1')
point_po2 = _me.Point('po2')
particle_p1 = _me.Particle('p1', _me.Point('p1_... | [
11748,
10558,
88,
13,
746,
23154,
13,
1326,
3147,
873,
355,
4808,
1326,
201,
198,
11748,
10558,
88,
355,
4808,
5796,
201,
198,
11748,
10688,
355,
285,
201,
198,
11748,
299,
32152,
355,
4808,
37659,
201,
198,
201,
198,
14535,
62,
77,
... | 1.723549 | 1,172 |
import filecmp, os, tempfile, unittest
from click.testing import CliRunner
from tenx.asm_stats import asm_stats_cmd, get_contig_lengths, get_scaffold_and_contig_lengths, get_stats, length_buckets
# -- AsmStatsTest
if __name__ == '__main__':
unittest.main(verbosity=2)
#-- __main__
| [
11748,
2393,
48991,
11,
28686,
11,
20218,
7753,
11,
555,
715,
395,
198,
6738,
3904,
13,
33407,
1330,
1012,
72,
49493,
198,
198,
6738,
3478,
87,
13,
8597,
62,
34242,
1330,
355,
76,
62,
34242,
62,
28758,
11,
651,
62,
3642,
328,
62,
... | 2.603604 | 111 |
import socket
import pickle
import random
import string
import time
import hashlib
import os
BUFFER_SIZE = 65536
| [
11748,
17802,
198,
11748,
2298,
293,
198,
11748,
4738,
198,
11748,
4731,
198,
11748,
640,
198,
11748,
12234,
8019,
198,
11748,
28686,
198,
198,
19499,
45746,
62,
33489,
796,
45021,
2623,
628,
628,
628,
198
] | 3.428571 | 35 |
import json
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from data_refinery_api.test.test_api_general import API_VERSION
from data_refinery_common.models import (
Experiment,
ExperimentOrganismAssociation,
ExperimentSampleAssociation,
Or... | [
11748,
33918,
198,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
3486,
2043,
395,
20448,
198,
198,
6738,
1366,
62,
5420,
15451,
62,
15042,
13,
92... | 3.266667 | 105 |
import pdftotext
import sys
import numpy as np
import pandas as pd
import regex as re
def get_server_type(server_type_str):
"""Check wether string is contained"""
server_type_list = server_type_str.split(' ')
if len(server_type_list) < 2:
if server_type_str == 'Backup':
return 'backu... | [
11748,
279,
67,
701,
1258,
742,
198,
11748,
25064,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
40364,
355,
302,
628,
198,
198,
4299,
651,
62,
15388,
62,
4906,
7,
15388,
62,
4906,
62,
25... | 2.510638 | 329 |
# random_forest.py
# does the random forest calcutlaions
import decision_tree
import partition
import heapq
import table_utils
import classifier_util
from homework_util import strat_folds
def run_a_table(table, indexes, class_index, N, M, F):
""" Takes a table, splits it into a training and test set. Creates a
... | [
2,
4738,
62,
29623,
13,
9078,
198,
2,
857,
262,
4738,
8222,
2386,
8968,
5031,
507,
198,
198,
11748,
2551,
62,
21048,
198,
11748,
18398,
198,
11748,
24575,
80,
198,
11748,
3084,
62,
26791,
198,
11748,
1398,
7483,
62,
22602,
198,
6738,
... | 2.869212 | 1,231 |
import tensorflow as tf
from tensorflow.python.framework import graph_util
from tensorflow.contrib.slim.python.slim.nets import alexnet
from tensorflow.python.ops import random_ops
from tensorflow.python.tools import optimize_for_inference_lib
from tensorflow.python.framework import dtypes
from tensorflow.core.framewor... | [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
29412,
13,
30604,
1330,
4823,
62,
22602,
198,
6738,
11192,
273,
11125,
13,
3642,
822,
13,
82,
2475,
13,
29412,
13,
82,
2475,
13,
45938,
1330,
257,
2588,
3262,
198... | 3.19375 | 160 |
default_app_config = "comic.container_exec.apps.CoreConfig"
| [
12286,
62,
1324,
62,
11250,
796,
366,
785,
291,
13,
34924,
62,
18558,
13,
18211,
13,
14055,
16934,
1,
198
] | 3 | 20 |
import requests
import json
import os
from bs4 import BeautifulSoup as bs
from secret import *
from smtplib import SMTP
from datetime import datetime
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
if __name__ == '__main__':
scraper()
| [
11748,
7007,
198,
11748,
33918,
198,
11748,
28686,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
355,
275,
82,
198,
6738,
3200,
1330,
1635,
198,
6738,
895,
83,
489,
571,
1330,
9447,
7250,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198... | 3.032609 | 92 |
'''
Copyright 2020 Xilinx 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 or agreed to in writing, software
distr... | [
7061,
6,
198,
15269,
12131,
1395,
346,
28413,
3457,
13,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
... | 2.535936 | 2,254 |
# Generated by Django 3.0 on 2020-01-07 07:56
import datetime
from django.db import migrations
from django.utils.timezone import utc
import tinymce.models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
319,
12131,
12,
486,
12,
2998,
8753,
25,
3980,
198,
198,
11748,
4818,
8079,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
198,
6738,
42625,
14208,
13,
26791,
13,
2435,
11340,
1330,
3384,
... | 3.078431 | 51 |