content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
198,
2,
15069,
33160,
1058,
33,
6532,
12,
22405,
12,
12041,
25,
19935,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
4943,
198,
2,
345,
743,... | 2.923221 | 534 |
import random
import timeit
import time
import re
from pathlib import Path
from typing import Tuple
from solution import (
highest_value_palindrome_suboptimal,
highest_value_palindrome_optimal,
)
TEST_DIR = Path(__file__).parent
random.seed(13)
def run(data_length):
"""
*data_length* is n in O(n)... | [
11748,
4738,
198,
11748,
640,
270,
198,
11748,
640,
198,
11748,
302,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
309,
29291,
198,
198,
6738,
4610,
1330,
357,
198,
220,
220,
220,
4511,
62,
8367,
62,
18596,
521,
5998,
62... | 2.61244 | 209 |
# MIT License
# Copyright (c) 2020 Simon Schug, João Sacramento
# 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, ... | [
2,
17168,
13789,
198,
198,
2,
15069,
357,
66,
8,
12131,
11288,
3059,
1018,
11,
5302,
28749,
19375,
198,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
... | 2.916098 | 1,025 |
# Copyright 2016 Georg Seifert. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: #www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
2,
15069,
1584,
6850,
1001,
361,
861,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
26... | 2.19387 | 1,305 |
#!/usr/bin/python
import pygame
import sys
import os
from pygame.locals import *
from context import *
from imagemanager import *
from sprite import *
from animation import *
from entity import *
from player import *
from npc import *
from random import randint
game = Game()
game.addEntity(NPC((0, 0), game.context.... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
12972,
6057,
198,
11748,
25064,
198,
11748,
28686,
198,
6738,
12972,
6057,
13,
17946,
874,
1330,
1635,
198,
6738,
4732,
1330,
1635,
198,
6738,
3590,
8463,
3536,
1330,
1635,
198,
6738,
33... | 2.795082 | 244 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-22 17:39
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,
1157,
13,
20,
319,
2177,
12,
1157,
12,
1828,
1596,
25,
2670,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.690909 | 55 |
import pandas as pd
import tqdm
from paths import PATHS
import os
if __name__ == "__main__":
main()
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
256,
80,
36020,
198,
6738,
13532,
1330,
28748,
7998,
198,
11748,
28686,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.7 | 40 |
import json
import escher
import modelseed_escher
import cobrakbase
from cobrakbase.core.converters import KBaseFBAModelToCobraBuilder
from modelseed_escher.convert_utils import move_to_compartment
#{'workspace_id': 37534, 'map_ids': ['dfsdfsdf'], 'grid_x': '1', 'grid_y': '1', 'model_objects': [{'object_ids': ['37534/9... | [
11748,
33918,
198,
11748,
1658,
2044,
198,
11748,
2746,
28826,
62,
274,
2044,
198,
11748,
22843,
17716,
8692,
198,
6738,
22843,
17716,
8692,
13,
7295,
13,
1102,
332,
1010,
1330,
14204,
589,
26001,
2390,
375,
417,
2514,
34,
672,
430,
328... | 2.456621 | 219 |
from pynytimes import NYTAPI
# Make sure to set parse dates to True so that the dates
# are parsed into datetime.datetime or datetime.date objects
nyt = NYTAPI(
key="Your API Key", # Get your API Key at https://developer.nytimes.com
parse_dates=True,
)
# Get most shared articles of today
most_shared = nyt.mo... | [
6738,
279,
2047,
20760,
999,
1330,
47243,
17614,
198,
198,
2,
6889,
1654,
284,
900,
21136,
9667,
284,
6407,
523,
326,
262,
9667,
198,
2,
389,
44267,
656,
4818,
8079,
13,
19608,
8079,
393,
4818,
8079,
13,
4475,
5563,
198,
3281,
83,
7... | 3.220217 | 277 |
import pandas as pd
import yfinance as yf
#from tqdm import tqdm
from RefreshStockAbv import getStockList
from datetime import datetime
stockList = pd.read_csv('Stock_List.csv')
stockListLen = len(stockList)
if __name__ == "__main__":
main() | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
331,
69,
14149,
355,
331,
69,
198,
2,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
22539,
26207,
4826,
85,
1330,
651,
26207,
8053,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
... | 2.850575 | 87 |
from django.db import models
from multiselectfield import MultiSelectField
# Create your models here.
PRODUCT_NAME = (
("Product-A", "Product A"),
("Product-B", "Product B"),
("Product-C", "Product C"),
)
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
1963,
786,
801,
3245,
1330,
15237,
17563,
15878,
198,
198,
2,
13610,
534,
4981,
994,
13,
198,
198,
4805,
28644,
62,
20608,
796,
357,
198,
220,
220,
220,
5855,
15667,
12,
32,
1600,
... | 2.933333 | 75 |
# -*- coding: utf-8 -*-
import multiprocessing as mp
import os
import sys
from argparse import ArgumentParser
from chainer import optimizers as optims
from chainer import serializers as S
from chainer.optimizer import GradientClipping, WeightDecay
from batch_generator import BatchGenerator
from loss import Loss
from... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
18540,
305,
919,
278,
355,
29034,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
198,
6738,
6333,
263,
1330,
6436,
1134... | 3.444444 | 126 |
#!/usr/bin/python
# -*-coding:utf-8-*-
import os,sys
import unittest
from os.path import expanduser
sys.path.append('../')
from wcs.commons.config import Config
from wcs.services.client import Client
from wcs.commons.putpolicy import PutPolicy
from wcs.commons.logme import debug
from wcs.commons.util import urlsafe_ba... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
198,
198,
11748,
28686,
11,
17597,
198,
11748,
555,
715,
395,
198,
6738,
28686,
13,
6978,
1330,
4292,
7220,
198,
17597,
13,
6978,
... | 1.324138 | 725 |
""" Convert HAR (HTTP Archive) to YAML/JSON testcase for HttpRunner.
Usage:
# convert to JSON format testcase
$ hrun har2case demo.har
# convert to YAML format testcase
$ hrun har2case demo.har -2y
"""
from httprunner2jmeter.ext.har2case.core import HarParser
from sentry_sdk import capture_message
... | [
37811,
38240,
43638,
357,
40717,
20816,
8,
284,
575,
2390,
43,
14,
40386,
1332,
7442,
329,
367,
29281,
49493,
13,
198,
198,
28350,
25,
198,
220,
220,
220,
1303,
10385,
284,
19449,
5794,
1332,
7442,
198,
220,
220,
220,
720,
289,
5143,
... | 2.525773 | 582 |
from .qmc import Qmc, QmcFastKron
from .layerwise import Layerwise
from .utils import *
| [
6738,
764,
80,
23209,
1330,
1195,
23209,
11,
1195,
23209,
22968,
42,
1313,
198,
6738,
764,
29289,
3083,
1330,
34398,
3083,
198,
6738,
764,
26791,
1330,
1635,
198
] | 3.142857 | 28 |
import os
import sys
import time
import random
import string
import datetime
import collections
try:
from beos_test_utils import run
except Exception as _ex:
print("Faild to import run.py script. Please make sure that run ./deploy.py --build-beos. Aborting.")
exit(1)
import beos_test_utils.beosactionpatt... | [
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
4738,
198,
11748,
4731,
198,
11748,
4818,
8079,
198,
11748,
17268,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
307,
418,
62,
9288,
62,
26791,
1330,
1057,
198,
16341,
... | 2.758491 | 265 |
#!/usr/bin/env python
# -*- coding: utf-8
# pytest unit tests for utils
import pytest
from spinalcordtoolbox import utils
def test_sct_argument_parser(capsys):
"""Test extra argparse functionality added by SCTArgumentParser subclass."""
# Check that new defaults can still be overridden (setting add_help vi... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
198,
2,
12972,
9288,
4326,
5254,
329,
3384,
4487,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
26234,
66,
585,
25981,
3524,
1330,
3384,
... | 2.913481 | 497 |
'''
################################################################
# Functions - Metrics
# @ Modern Deep Network Toolkits for Tensorflow-Keras
# Yuchen Jin @ cainmagi@gmail.com
# Requirements: (Pay attention to version)
# python 3.6+
# tensorflow r1.13+
# Extend metrics. These functions should not be used as trai... | [
7061,
6,
198,
29113,
29113,
198,
2,
40480,
532,
3395,
10466,
198,
2,
2488,
12495,
10766,
7311,
16984,
74,
896,
329,
309,
22854,
11125,
12,
42,
263,
292,
198,
2,
575,
1229,
831,
17297,
2488,
269,
391,
76,
18013,
31,
14816,
13,
785,
... | 2.488806 | 2,144 |
import numpy as np
from scipy.integrate import odeint
from scipy.special import legendre, chebyt
import sys
sys.path.append('../src')
from sindy_utils import library_size
from data_manage import DataStruct
import pdb
#################################
################################
###############################... | [
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
18908,
4873,
1330,
267,
2934,
600,
198,
6738,
629,
541,
88,
13,
20887,
1330,
8177,
260,
11,
1125,
1525,
83,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
40720,
... | 2.269528 | 1,165 |
'''
Author: Jacob Howard-Parker
Functions for writing on images. Text args should be layed out as
specified in data/templates/image_configuration.json
'''
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
import textwrap
import re
import pandas as pd
def create_base_image(background=(26,26,2... | [
7061,
6,
198,
13838,
25,
12806,
8442,
12,
25478,
263,
198,
24629,
2733,
329,
3597,
319,
4263,
13,
8255,
26498,
815,
307,
3830,
276,
503,
355,
220,
198,
23599,
287,
1366,
14,
11498,
17041,
14,
9060,
62,
11250,
3924,
13,
17752,
198,
7... | 2.10049 | 2,448 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from fastapi import FastAPI
from fastapi_contrib.db.client import MongoDBClient
from fastapi_contrib.db.models import MongoDBModel, MongoDBTimeStampedModel
from tests.mock import MongoDBMock
from tests.utils import override_settings, AsyncMock, AsyncIterator... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
12972,
9288,
198,
198,
6738,
3049,
15042,
1330,
12549,
17614,
198,
198,
6738,
3049,
15042,
62,
3642,
822,
13,
99... | 2.639764 | 508 |
import fire
import os
import torch
import torchvision as tv
from torch.utils.data.sampler import SubsetRandomSampler
from models import DenseNet
from temperature_scaling import ModelWithTemperature
def demo(data, save, depth=40, growth_rate=12, batch_size=256):
"""
Applies temperature scaling to a trained mod... | [
11748,
2046,
198,
11748,
28686,
198,
11748,
28034,
198,
11748,
28034,
10178,
355,
31557,
198,
6738,
28034,
13,
26791,
13,
7890,
13,
37687,
20053,
1330,
3834,
2617,
29531,
16305,
20053,
198,
6738,
4981,
1330,
360,
1072,
7934,
198,
6738,
59... | 2.858824 | 1,190 |
import time
from concurrent import futures
from multiprocessing import Queue,Process
from threading import Event
import grpc
from . import SpyPipeGRPC_pb2 as proto_pb2
from . import SpyPipeGRPC_pb2_grpc as proto_pb2_grpc
#def stop_process(self):
# print('run stop process')
if __name__ ==... | [
198,
11748,
640,
198,
6738,
24580,
220,
220,
220,
220,
220,
1330,
25650,
198,
6738,
18540,
305,
919,
278,
1330,
4670,
518,
11,
18709,
198,
6738,
4704,
278,
220,
220,
220,
220,
220,
220,
1330,
8558,
198,
198,
11748,
1036,
14751,
198,
... | 2.469697 | 396 |
import json
from django.db import models
from .model_factory import RegisterJSONEncoder
# TODO: require register field parameter to enable type coercion; Field needs to be deconstructable
# TODO: base code on django.contrib.postgres.fields.array.ArrayField
# TODO: add form field
| [
11748,
33918,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
6738,
764,
19849,
62,
69,
9548,
1330,
17296,
40386,
27195,
12342,
628,
220,
220,
220,
1303,
16926,
46,
25,
2421,
7881,
2214,
11507,
284,
7139,
2099,
32000,
26,
... | 3.430233 | 86 |
"""
Module: 'umqtt.simple' on LEGO EV3 v1.0.0
"""
# MCU: sysname=ev3, nodename=ev3, release=('v1.0.0',), version=('0.0.0',), machine=ev3
# Stubber: 1.3.2 - updated
from typing import Any
class MQTTClient:
""""""
class MQTTException(Exception):
""""""
socket = None
struct = None
| [
37811,
198,
26796,
25,
705,
388,
80,
926,
13,
36439,
6,
319,
29108,
8696,
18,
410,
16,
13,
15,
13,
15,
198,
37811,
198,
2,
13122,
52,
25,
25064,
3672,
28,
1990,
18,
11,
18666,
12453,
28,
1990,
18,
11,
2650,
28,
10786,
85,
16,
... | 2.352 | 125 |
# -*- coding: utf-8 -*-
import cv2
# トラックバーの値を変更する度にRGBを出力する
# 画像の読み込み
# img = cv2.imread("../../../../resources/capture_l_plane.png", 1)
img = cv2.imread("../../../../resources/result.png", 1)
# img = cv2.resize(img , (int(img.shape[1]*0.5), int(img.shape[0]*0.5)))
# ウィンドウのサイズを変更可能にする
cv2.namedWindow("img", cv2.WIND... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
269,
85,
17,
198,
198,
2,
220,
13298,
9263,
35702,
29659,
6312,
15474,
222,
97,
31758,
13783,
231,
162,
249,
112,
33623,
25748,
41753,
99,
28618,
36982,
31758,
49... | 1.884354 | 441 |
#
# PySNMP MIB module DLSW-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DLSW-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:07:01 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:1... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
360,
6561,
54,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,
14,
14490,
14,
67,
615,
47562,
19,
... | 2.996262 | 40,666 |
import os
import re
import sys
import time
import tempfile
from joblib import Parallel, delayed
from urllib.parse import unquote
from collections import Counter
def upcase_first_letter(s):
"""
Capitalize the string.
"""
return s[0].upper() + s[1:]
def replaceAnchorText(filename):
"""
Given the input file, th... | [
11748,
28686,
198,
11748,
302,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
20218,
7753,
198,
6738,
1693,
8019,
1330,
42945,
11,
11038,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
555,
22708,
198,
6738,
17268,
1330,
15034,
198,
198,
... | 2.572241 | 1,758 |
words = ['car', 'window', 'ddd']
print('------一般遍历------------')
for w in words[1:-1]:
print(w, len(w))
print('------带索引的遍历1------------')
for index, w in enumerate(words):
print(index, w)
print('------带索引的遍历2------------')
for index, w in enumerate(words, start=1):
print(index, w)
maps = {'10': 'sun'... | [
10879,
796,
37250,
7718,
3256,
705,
17497,
3256,
705,
1860,
67,
20520,
198,
198,
4798,
10786,
23031,
31660,
48958,
105,
34402,
235,
43889,
228,
10541,
11537,
198,
1640,
266,
287,
2456,
58,
16,
21912,
16,
5974,
198,
220,
220,
220,
3601,
... | 2.155125 | 361 |
import argparse
import os
import cv2
# initialize the list of reference points
refPt = []
r = None
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-p", "--path", required=True, help="Path to the images")
ap.add_argument("-a", "--annotate", required=False, h... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
198,
11748,
269,
85,
17,
198,
198,
2,
41216,
262,
1351,
286,
4941,
2173,
198,
5420,
47,
83,
796,
17635,
198,
81,
796,
6045,
628,
628,
198,
198,
2,
5678,
262,
4578,
30751,
290,
21136,
262,
... | 1.944781 | 1,322 |
import wikiquote
# manual_checks.py
# A short script to manually test wikiquote's functionality
MAX_QUOTE_LEN = 70
articles = [
'Barack Obama',
'Albert Einstein',
'Ada Lovelace',
'Leonard Cohen'
]
for lang in wikiquote.supported_languages():
print('\n---------------------------------------------... | [
11748,
47145,
1557,
1258,
198,
198,
2,
10107,
62,
42116,
13,
9078,
198,
2,
317,
1790,
4226,
284,
14500,
1332,
47145,
1557,
1258,
338,
11244,
198,
198,
22921,
62,
10917,
23051,
62,
43,
1677,
796,
4317,
198,
198,
26845,
796,
685,
198,
... | 2.01385 | 722 |
"""
-*- test-case-name: PyHouse.src.Modules.Web.test.test_web_configMenu -*-
@name: PyHouse/src/Modules/Web/web_configMenu.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com
@copyright: (c) 2015-2015 by D. Brian Kimmel
@license: MIT License
@note: Created on Aug 23, 2015
@Summary:
... | [
37811,
201,
198,
12,
9,
12,
1332,
12,
7442,
12,
3672,
25,
9485,
18102,
13,
10677,
13,
5841,
5028,
13,
13908,
13,
9288,
13,
9288,
62,
12384,
62,
11250,
23381,
532,
9,
12,
201,
198,
201,
198,
31,
3672,
25,
220,
220,
220,
220,
220,... | 2.532432 | 370 |
import soundfile
import sounddevice
if __name__ == '__main__':
record = Record_Sound()
record.record_sound()
| [
11748,
2128,
7753,
201,
198,
11748,
2128,
25202,
201,
198,
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
1700,
796,
13266,
62,
21369,
3419,
201,
198,
220,
220,
220,
... | 2.56 | 50 |
from .placeholder_prior import PlaceholderDelta, PlaceholderPrior
from .prior import RestrictedPrior
| [
6738,
764,
5372,
13829,
62,
3448,
273,
1330,
8474,
13829,
42430,
11,
8474,
13829,
22442,
198,
6738,
764,
3448,
273,
1330,
8324,
20941,
22442,
198
] | 4.04 | 25 |
# coding: utf-8
from __future__ import unicode_literals, absolute_import
import json
from .base_endpoint import BaseEndpoint
from ..pagination.limit_offset_based_object_collection import LimitOffsetBasedObjectCollection
from ..pagination.marker_based_object_collection import MarkerBasedObjectCollection
from ..util.a... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
11,
4112,
62,
11748,
198,
198,
11748,
33918,
198,
198,
6738,
764,
8692,
62,
437,
4122,
1330,
7308,
12915,
4122,
198,
6738,
11485,
... | 2.183666 | 8,559 |
import unittest
| [
11748,
555,
715,
395,
628
] | 3.4 | 5 |
from dataclasses import dataclass
from typing import Any, Callable, Dict, Optional, Sequence, Union
@dataclass(frozen=True)
| [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
19720,
1330,
4377,
11,
4889,
540,
11,
360,
713,
11,
32233,
11,
45835,
11,
4479,
628,
198,
31,
19608,
330,
31172,
7,
69,
42005,
28,
17821,
8,
198
] | 3.315789 | 38 |
# Copyright (c) 2015-2018 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
from scipy import optimize
from scipy.signal import fftconvolve
from toast.mpi import MPI
import numpy as np
import toast.tim... | [
2,
15069,
357,
66,
8,
1853,
12,
7908,
416,
262,
4671,
5610,
287,
262,
37195,
20673,
2393,
13,
198,
2,
1439,
2489,
10395,
13,
220,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
198,
2,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,... | 3.457944 | 107 |
import numpy as np
from math import pi,cos,sin,sqrt
from dlib import point, get_rect, center
import dlib
###########################################################################################
###########################################################################################
########################... | [
198,
11748,
299,
32152,
355,
45941,
198,
6738,
10688,
1330,
31028,
11,
6966,
11,
31369,
11,
31166,
17034,
198,
6738,
288,
8019,
1330,
966,
11,
651,
62,
2554,
11,
3641,
198,
11748,
288,
8019,
198,
198,
29113,
29113,
14468,
7804,
21017,
... | 4.324159 | 327 |
import os
from flask import Flask, flash, redirect, render_template, request, session, abort, url_for, make_response, Response
import sys
import yaml
import os.path
import base64
from predict_digit import *
from matplotlib import image as mplimg
import cv2
import numpy as np
#from flask_json import FlaskJSON, JsonError... | [
11748,
28686,
198,
6738,
42903,
1330,
46947,
11,
7644,
11,
18941,
11,
8543,
62,
28243,
11,
2581,
11,
6246,
11,
15614,
11,
19016,
62,
1640,
11,
787,
62,
26209,
11,
18261,
198,
11748,
25064,
198,
11748,
331,
43695,
198,
11748,
28686,
13... | 2.87234 | 235 |
from typing import List
import structlog
import tempfile
import shutil
import os
from genny.cmd_runner import run_command
from genny.curator import poplar_grpc
from genny.tasks import preprocess
SLOG = structlog.get_logger(__name__)
def main_genny_runner(
genny_args: List[str],
genny_repo_root: str,
cl... | [
6738,
19720,
1330,
7343,
198,
198,
11748,
2878,
6404,
198,
11748,
20218,
7753,
198,
11748,
4423,
346,
198,
11748,
28686,
198,
198,
6738,
308,
11870,
13,
28758,
62,
16737,
1330,
1057,
62,
21812,
198,
6738,
308,
11870,
13,
22019,
1352,
13... | 2.083633 | 1,112 |
# -*- coding: utf-8 -*- #
"""telesurvideos CMS plugins"""
from __future__ import unicode_literals
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from django.utils.translation import ugettext_lazy as _
from .models import ProgramaListPluginModel, VideoListPluginModel
class Programa... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
1303,
198,
37811,
37524,
274,
333,
32861,
40773,
20652,
37811,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
269,
907,
13,
33803,
62,
8692,
... | 2.132974 | 1,113 |
import os
import shutil
import subprocess
from pathlib import Path
from ..lib.polisher import (
PolishPipeline,
create_sorted_aln,
pilon,
ShortReadPolishRunner,
)
draft = Path("test_data/drafts/assembly.fasta")
r1, r2 = ["test_data/r1.fastq", "test_data/r2.fastq"]
long_reads = "test_data/long.fastq"
... | [
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
850,
14681,
198,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
11485,
8019,
13,
16104,
4828,
1330,
357,
198,
220,
220,
220,
15945,
47,
541,
4470,
11,
198,
220,
220,
220,
2251,
62,... | 2.34322 | 236 |
fname = input("Enter your first name: ")
lname = input("Enter your last name: ")
age = int(input("Enter your age: "))
print('''First name: {0}
Last name: {1}
Age: {2}'''.format(fname.capitalize(), lname.upper(), age))
| [
69,
3672,
796,
5128,
7203,
17469,
534,
717,
1438,
25,
366,
8,
198,
75,
3672,
796,
5128,
7203,
17469,
534,
938,
1438,
25,
366,
8,
198,
496,
796,
493,
7,
15414,
7203,
17469,
534,
2479,
25,
366,
4008,
198,
198,
4798,
7,
7061,
6,
59... | 2.703704 | 81 |
"""
Should emit:
B017 - on lines 15, 20, 25
All tests are valid unittest syntax, and will work if this code
is executed.
"""
import asyncio
import unittest
# None of these should trigger the With visitor.
CONSTANT = True
# This may trigger the visitor, but it shouldn't match the filters
with Foo() as a:
p... | [
37811,
198,
19926,
27588,
25,
198,
33,
29326,
532,
319,
3951,
1315,
11,
1160,
11,
1679,
198,
198,
3237,
5254,
389,
4938,
555,
715,
395,
15582,
11,
290,
481,
670,
611,
428,
2438,
198,
271,
10945,
13,
198,
37811,
198,
11748,
30351,
95... | 3.056911 | 123 |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('LICENSE') as f:
license = f.read()
#with open('README.rst') as f:
#readme = f.read()
setup(
name='DeepSentiment',
version='0.1.0',
description='Deep Learning for Sentiment Analysis',
#long_description=read... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
4480,
1280,
10786,
43,
2149,
24290,
11537,
355,
277,
25,
198,
220,
220,
220,
5964,
796,
277,
1... | 1.926959 | 753 |
from django.contrib import admin
from .models import Post, Comment, Author, Category, CanSee, FriendRequest, \
Follow, RemoteCommentAuthor
# Register your models here.
admin.site.register(Author)
admin.site.register(RemoteCommentAuthor)
admin.site.register(Post)
admin.site.register(Comment)
admin.... | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
2947,
11,
18957,
11,
6434,
11,
21743,
11,
1680,
6214,
11,
9182,
18453,
11,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,... | 3.129496 | 139 |
# This package had a lot of inspiration and snippes from the following Gist
# https://gist.github.com/vbe0201/ade9b80f2d3b64643d854938d40a0a2d
| [
2,
770,
5301,
550,
257,
1256,
286,
12141,
290,
26911,
274,
422,
262,
1708,
402,
396,
198,
2,
3740,
1378,
70,
396,
13,
12567,
13,
785,
14,
85,
1350,
15,
1264,
14,
671,
24,
65,
1795,
69,
17,
67,
18,
65,
2414,
41813,
67,
5332,
29... | 2.6 | 55 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import itertools
from distutils.version import LooseVersion as V
from nose.tools import assert_raises
import numpy as np
from numpy.testing.utils import assert_array_equal, assert_array_almost_equa... | [
6738,
11593,
37443,
834,
1330,
357,
48546,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28000,
1098,
62,
17201... | 1.796955 | 6,831 |
import enum
| [
11748,
33829,
628,
198
] | 3.5 | 4 |
from certn.api.api import API
| [
6738,
5051,
77,
13,
15042,
13,
15042,
1330,
7824,
628
] | 3.1 | 10 |
# Generated by Django 3.0.10 on 2020-09-15 07:07
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
940,
319,
12131,
12,
2931,
12,
1314,
8753,
25,
2998,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
import datetime
import re
import logging
import random
from google.appengine.api import memcache
from google.appengine.api import mail
from google.appengine.api import search
from google.appengine.api import users
from google.appengine.ext import db
from google.appengine.ext import deferred
import ctrl
import ctr... | [
198,
198,
11748,
4818,
8079,
198,
11748,
302,
198,
11748,
18931,
198,
11748,
4738,
198,
198,
6738,
23645,
13,
1324,
18392,
13,
15042,
1330,
1066,
23870,
198,
6738,
23645,
13,
1324,
18392,
13,
15042,
1330,
6920,
198,
6738,
23645,
13,
132... | 2.709701 | 5,515 |
import random
from bot import Command, utils, categories
url_settings = {
'cat': ['http://aws.random.cat/meow', ['gato', 'gatito', 'neko'], 'file'],
'dog': ['https://dog.ceo/api/breeds/image/random', ['perro', 'perrito', 'doggo'], 'message'],
'shiba': ['http://shibe.online/api/shibes', ['shibe', 'shibainu... | [
11748,
4738,
198,
198,
6738,
10214,
1330,
9455,
11,
3384,
4487,
11,
9376,
198,
198,
6371,
62,
33692,
796,
1391,
198,
220,
220,
220,
705,
9246,
10354,
37250,
4023,
1378,
8356,
13,
25120,
13,
9246,
14,
1326,
322,
3256,
37250,
70,
5549,
... | 2.328076 | 317 |
import multiprocessing.connection
import os
import socket
import sys
import socket
from .protocol import Protocol
# a small hack to make the listener support non-blocking and timeout mode
# Connector class
| [
198,
11748,
18540,
305,
919,
278,
13,
38659,
198,
11748,
28686,
198,
11748,
17802,
198,
11748,
25064,
198,
11748,
17802,
198,
198,
6738,
764,
11235,
4668,
1330,
20497,
198,
198,
2,
257,
1402,
8156,
284,
787,
262,
24783,
1104,
1729,
12,
... | 4.038462 | 52 |
import random
| [
11748,
4738,
628,
628
] | 4.25 | 4 |
import subprocess
# need to run setup.py first to make sure all our changes are compiled before running
# if you didn't make changes to aioquic, you can comment this step out
# need to run this from inside the root dir
# so do python3 scripts/run_tests.py
print("Compiling...")
process = subprocess.run("{}".format("... | [
198,
198,
11748,
850,
14681,
198,
198,
2,
761,
284,
1057,
9058,
13,
9078,
717,
284,
787,
1654,
477,
674,
2458,
389,
14102,
878,
2491,
198,
2,
611,
345,
1422,
470,
787,
2458,
284,
257,
952,
421,
291,
11,
345,
460,
2912,
428,
2239,
... | 2.032742 | 4,337 |
"""Constants used by Advantage Air integration."""
DOMAIN = "advantage_air"
ADVANTAGE_AIR_RETRY = 5
ADVANTAGE_AIR_STATE_OPEN = "open"
ADVANTAGE_AIR_STATE_CLOSE = "close"
ADVANTAGE_AIR_STATE_ON = "on"
ADVANTAGE_AIR_STATE_OFF = "off"
| [
37811,
34184,
1187,
973,
416,
45318,
3701,
11812,
526,
15931,
198,
39170,
29833,
796,
366,
13461,
496,
62,
958,
1,
198,
2885,
53,
8643,
11879,
62,
42149,
62,
2200,
40405,
796,
642,
198,
2885,
53,
8643,
11879,
62,
42149,
62,
44724,
62,... | 2.468085 | 94 |
print(maxConsecutiveOnes(14)) # Output = 3 as binary(14) = 1110
| [
198,
4798,
7,
9806,
3103,
4552,
425,
2202,
274,
7,
1415,
4008,
220,
220,
1303,
25235,
796,
513,
355,
13934,
7,
1415,
8,
796,
1367,
940,
198
] | 2.481481 | 27 |
from abc import ABC, abstractmethod
| [
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
628
] | 3.8 | 10 |
# -*- coding: utf-8 -*-
"""
This module recieves an ForecastIO object and holds the minutely weather
conditions. It has one class for this purpose.
"""
class FIOMinutely(object):
"""
This class recieves an ForecastIO object and holds the minutely weather
conditions. It has one class for this purpose.
"... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
1212,
8265,
664,
17974,
281,
4558,
2701,
9399,
2134,
290,
6622,
262,
5664,
306,
6193,
198,
17561,
1756,
13,
632,
468,
530,
1398,
329,
428,
4007,
13,
198,
3... | 2.392902 | 789 |
import math
import random
import pandas as pd
from Neuron import Neuron
from Neuron import getNormalised
from Visualiser import Visualiser
if __name__ == '__main__':
main()
# if 4 neurons are used then one is left unused as a cluster i.e it is extra
# if 3 neurons all are used
| [
11748,
10688,
198,
11748,
4738,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
3169,
44372,
1330,
3169,
44372,
198,
6738,
3169,
44372,
1330,
651,
26447,
1417,
198,
6738,
15612,
5847,
1330,
15612,
5847,
198,
198,
361,
11593,
3672,
834,
... | 3.469136 | 81 |
"""
Functions:
wait
"""
TIMERS = {} # name -> time
| [
37811,
198,
198,
24629,
2733,
25,
198,
17077,
198,
198,
37811,
198,
198,
51,
3955,
4877,
796,
23884,
220,
220,
1303,
1438,
4613,
640,
198
] | 2.24 | 25 |
"""
Queue Using Linked List
"""
# Python3 program to demonstrate linked list
# based implementation of queue
# A linked list (LL) node
# to store a queue entry
# A class to represent a queue
# The queue, front stores the front node
# of LL and rear stores the last node of LL
# Method to add an item to the queu... | [
37811,
198,
198,
34991,
8554,
7502,
276,
7343,
198,
198,
37811,
198,
198,
2,
11361,
18,
1430,
284,
10176,
6692,
1351,
198,
2,
1912,
7822,
286,
16834,
198,
198,
2,
317,
6692,
1351,
357,
3069,
8,
10139,
198,
2,
284,
3650,
257,
16834,
... | 2.75 | 224 |
import pandas as pd
from dagster_pandas.constraints import ConstraintViolationException
from dagster_pandas.validation import validate_collection_schema
from dagster import (
DagsterInvariantViolationError,
EventMetadataEntry,
Field,
Materialization,
Path,
String,
TypeCheck,
as_dagster_... | [
11748,
19798,
292,
355,
279,
67,
198,
6738,
48924,
1706,
62,
79,
392,
292,
13,
1102,
2536,
6003,
1330,
1482,
2536,
2913,
33894,
341,
16922,
198,
6738,
48924,
1706,
62,
79,
392,
292,
13,
12102,
341,
1330,
26571,
62,
43681,
62,
15952,
... | 2.4 | 615 |
cfg = open('config.user').read().splitlines()
bonecho = open('bone.echo').read().strip()
el = open('echo/%s' % bonecho).read().splitlines()
lastbone = open('msg/%s' % el[-1]).read().splitlines()[8:]
if lastbone:
open('bone.echo','w').write(lastbone[0])
open('config.cfg','w').write('\n'.join(cfg+lastbone+['']))... | [
37581,
796,
1280,
10786,
11250,
13,
7220,
27691,
961,
22446,
35312,
6615,
3419,
198,
15992,
6679,
796,
1280,
10786,
15992,
13,
30328,
27691,
961,
22446,
36311,
3419,
198,
417,
796,
1280,
10786,
30328,
14,
4,
82,
6,
4064,
9970,
6679,
737... | 2.568 | 125 |
from django.conf.urls import patterns, url
from quotes import views
from views import *
urlpatterns = patterns('',
url(r'^sdf$', index, name='index'),
url(r'^$', GameView.as_view(), name='game'),
url(r'^post$', AnswerView.as_view(), name='answer'),
url(r'^edit$', QuoteUpdate.as_view(), name='update'),
)
... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
19016,
201,
198,
6738,
13386,
1330,
5009,
201,
198,
6738,
5009,
1330,
1635,
201,
198,
220,
201,
198,
6371,
33279,
82,
796,
7572,
10786,
3256,
201,
198,
197,
6371,
7,
81,
6... | 2.58871 | 124 |
# -*- coding: utf-8 -*-
"""
Payment utility functions.
These are mostly one-off functions. Define the bulk of Stripe operations on
:py:class:`readthedocs.payments.forms.StripeResourceMixin`.
"""
import structlog
import stripe
from django.conf import settings
stripe.api_key = settings.STRIPE_SECRET
log = structlo... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
19197,
434,
10361,
5499,
13,
198,
198,
4711,
389,
4632,
530,
12,
2364,
5499,
13,
2896,
500,
262,
11963,
286,
26137,
431,
4560,
319,
198,
25,
9078,
25,... | 2.593688 | 507 |
# Copyright 2022 DeChainers
#
# 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, so... | [
2,
15069,
33160,
1024,
35491,
364,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743... | 2.234226 | 5,341 |
"""
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
from cfnlint.rules import CloudFormationLintRule
from cfnlint.rules import RuleMatch
class PropertiesTagsRequired(CloudFormationLintRule):
"""Check if Tags have required keys"""
id = 'E9000'
shor... | [
37811,
198,
15269,
13130,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
4303,
36227,
12,
34156,
12,
33234,
7483,
25,
17168,
12,
15,
198,
37811,
198,
6738,
30218,
21283,
600,
13,
38785,
1330,
10130,
8479... | 2.257692 | 520 |
import datetime
from .. import db, dt_delta
warns = db.warn_s
settings = db.warn_settings
| [
11748,
4818,
8079,
198,
198,
6738,
11485,
1330,
20613,
11,
288,
83,
62,
67,
12514,
198,
198,
40539,
82,
796,
20613,
13,
40539,
62,
82,
198,
33692,
796,
20613,
13,
40539,
62,
33692,
628,
628,
628,
628,
628,
628,
198
] | 2.6 | 40 |
# print i, initL1UniformTags.tagBaseVec[ i ]
| [
2,
220,
220,
220,
220,
220,
220,
220,
3601,
1312,
11,
2315,
43,
16,
3118,
6933,
36142,
13,
12985,
14881,
53,
721,
58,
1312,
2361,
198
] | 2 | 26 |
import numpy as np
import torch
from conformer_rl import utils
from conformer_rl.agents import A2CAgent
from conformer_rl.config import Config
from conformer_rl.environments import Task
from conformer_rl.models import RTGN
from conformer_rl.molecule_generation import test_alkane
device = torch.device("cuda:0" if tor... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
198,
6738,
369,
16354,
62,
45895,
1330,
3384,
4487,
198,
6738,
369,
16354,
62,
45895,
13,
49638,
1330,
317,
17,
8141,
6783,
198,
6738,
369,
16354,
62,
45895,
13,
11250,
1330,
17056,... | 2.617978 | 534 |
from __future__ import annotations
from typing import Dict, List, Optional, Union
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from nlp.nlp import Trainer
app = FastAPI()
trainer = Trainer()
#BaseModel is used as data validator when using fast api it cares all about exception handilng and ... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
32233,
11,
4479,
198,
6738,
3049,
15042,
1330,
12549,
17614,
11,
14626,
16922,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
198,
6738,
299,
34431,
1... | 3.57767 | 206 |
CACHE_DIR = '_cache'
ASSETS_DIR = 'assets'
TEMPLATES_DIR = 'templates'
THEME_DIR = 'theme'
THEMES_DIR = 'themes'
PLUGINS_DIR = 'plugins'
CONFIG_PATH = 'config.yml'
THEME_CONFIG_PATH = 'theme_config.yml'
THEME_INFO_PATH = 'theme_info.yml'
ASSET_DIR_SUFFIX = '-assets'
DEFAULT_FORMAT = 'markdown'
DEFAULT_TEMPLATE_ENGIN... | [
198,
34,
2246,
13909,
62,
34720,
796,
705,
62,
23870,
6,
198,
10705,
32716,
62,
34720,
796,
705,
19668,
6,
198,
51,
3620,
6489,
29462,
62,
34720,
796,
705,
11498,
17041,
6,
198,
4221,
3620,
36,
62,
34720,
796,
705,
43810,
6,
198,
... | 2.257053 | 319 |
import os
import hashlib
| [
11748,
28686,
198,
11748,
12234,
8019,
628,
628
] | 3.5 | 8 |
"""
Conversion of low-level events to high-level causes, and handling them.
These functions are invoked from the queueing module `kopf.reactor.queueing`,
which are the actual event loop of the operator process.
The conversion of the low-level events to the high-level causes is done by
checking the object's state and ... | [
37811,
198,
3103,
9641,
286,
1877,
12,
5715,
2995,
284,
1029,
12,
5715,
5640,
11,
290,
9041,
606,
13,
198,
198,
4711,
5499,
389,
24399,
422,
262,
16834,
278,
8265,
4600,
74,
404,
69,
13,
260,
11218,
13,
36560,
278,
47671,
198,
4758,... | 2.796449 | 8,224 |
# -*- coding: utf-8 -*-
from contextlib import contextmanager
# from snipy.odict import odict
_stack = [None]
@contextmanager
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
2,
422,
3013,
541,
88,
13,
375,
713,
1330,
267,
11600,
198,
198,
62,
25558,
796,
685,
14202,
60,
628,
198,
198,
31,
22866,
... | 2.75 | 48 |
try:
import listeners
except ImportError:
pass
| [
28311,
25,
198,
220,
220,
220,
1330,
22054,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
1208,
198
] | 2.894737 | 19 |
from setuptools import setup, find_packages, Extension
from pathlib import Path
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()
VERSION = '0.0.6'
DESCRIPTION = 'Library used to Normalize numerical time-series data'
LONG_DESCRIPTION = 'A package that allows ... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
11,
27995,
201,
198,
201,
198,
6738,
3108,
8019,
1330,
10644,
201,
198,
5661,
62,
34945,
796,
10644,
7,
834,
7753,
834,
737,
8000,
201,
198,
6511,
62,
11213,
796,
357,
5661,
... | 2.927536 | 414 |
from django.urls import path
from grandchallenge.hanging_protocols.views import (
HangingProtocolCreate,
HangingProtocolDetail,
HangingProtocolList,
HangingProtocolUpdate,
)
app_name = "hanging-protocols"
urlpatterns = [
path("", HangingProtocolList.as_view(), name="list"),
path(... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
201,
198,
201,
198,
6738,
4490,
36747,
3540,
13,
71,
4924,
62,
11235,
4668,
82,
13,
33571,
1330,
357,
201,
198,
220,
220,
220,
367,
4924,
19703,
4668,
16447,
11,
201,
198,
220,
220,
220,... | 2.540284 | 211 |
#!/usr/bin/env python
'''
MIT License
Copyright (c) 2021 Stephen Hausler, Sourav Garg, Ming Xu, Michael Milford and Tobias Fischer
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 restric... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
7061,
6,
198,
36393,
13789,
198,
198,
15269,
357,
66,
8,
33448,
7970,
367,
8717,
1754,
11,
22862,
4108,
39013,
11,
26980,
33591,
11,
3899,
4460,
3841,
290,
46675,
30901,
198,
198,... | 2.418259 | 4,973 |
from output.models.sun_data.attr_decl.ad_name.ad_name00104m.ad_name00104m5_xsd.ad_name00104m5 import Root
__all__ = [
"Root",
]
| [
6738,
5072,
13,
27530,
13,
19155,
62,
7890,
13,
35226,
62,
32446,
13,
324,
62,
3672,
13,
324,
62,
3672,
405,
13464,
76,
13,
324,
62,
3672,
405,
13464,
76,
20,
62,
87,
21282,
13,
324,
62,
3672,
405,
13464,
76,
20,
1330,
20410,
19... | 2.180328 | 61 |
from netapp.netapp_object import NetAppObject
class FilterAttrsInfo(NetAppObject):
"""
List of filters based on attributes of an
aggregate.
"""
_is_local = None
@property
def is_local(self):
"""
If true, returns aggregates owned by the local
node. It includes ta... | [
6738,
2010,
1324,
13,
3262,
1324,
62,
15252,
1330,
3433,
4677,
10267,
198,
198,
4871,
25853,
8086,
3808,
12360,
7,
7934,
4677,
10267,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7343,
286,
16628,
1912,
319,
12608,
286,
281,
1... | 2.23023 | 999 |
from ._version import __version__
__author__ = 'Raisul Islam'
"""
for trading data
"""
from bdshare.stock.trading import (get_current_trade_data, get_dsex_data, get_current_trading_code,
get_hist_data, get_basic_hist_data,
get_close_price_data, ge... | [
6738,
47540,
9641,
1330,
11593,
9641,
834,
198,
834,
9800,
834,
796,
705,
49,
15152,
377,
3449,
6,
198,
198,
37811,
198,
1640,
7313,
1366,
198,
37811,
198,
6738,
275,
67,
20077,
13,
13578,
13,
2213,
4980,
1330,
357,
1136,
62,
14421,
... | 2.290076 | 262 |
from contextlib import contextmanager
from erde.io.base import BaseReader, BaseWriter, BaseDriver
from shapely.geometry import Point, LineString, Polygon
from time import sleep
from unittest import mock
from unittest.mock import patch, Mock
import geopandas as gpd
import pytest
import sys
import traceback as tb
d = '... | [
6738,
4732,
8019,
1330,
4732,
37153,
198,
6738,
1931,
2934,
13,
952,
13,
8692,
1330,
7308,
33634,
11,
7308,
34379,
11,
7308,
32103,
198,
6738,
5485,
306,
13,
469,
15748,
1330,
6252,
11,
6910,
10100,
11,
12280,
14520,
198,
6738,
640,
1... | 3.092593 | 162 |
# -*- coding: utf-8 -*-
import pytest
from bildungslogin_plugin.models import User
@pytest.mark.parametrize(
"test_data",
(
("id", ""),
("first_name", ""),
("last_name", ""),
("licenses", {""}),
("context", {}),
),
)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
12972,
9288,
198,
198,
6738,
275,
688,
2150,
82,
38235,
62,
33803,
13,
27530,
1330,
11787,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7... | 1.964029 | 139 |
locked = {}
locked["http_archive> tar.gz github.com/bazelbuild/bazel-skylib ~=0.8 "] = {"sha256": "1dde365491125a3db70731e25658dfdd3bc5dbdfd11b840b3e987ecf043c7ca0", "url": "https://github.com/bazelbuild/bazel-skylib/releases/download/0.9.0/bazel_skylib-0.9.0.tar.gz"}
| [
24162,
796,
23884,
198,
24162,
14692,
4023,
62,
17474,
29,
220,
13422,
13,
34586,
33084,
13,
785,
14,
65,
41319,
11249,
14,
65,
41319,
12,
15688,
8019,
5299,
28,
15,
13,
23,
366,
60,
796,
19779,
26270,
11645,
1298,
366,
16,
1860,
68... | 2.16 | 125 |
# Problem 46: Goldbach's other conjecture
# https://projecteuler.net/problem=46
#
if __name__ == '__main__':
import sys
if len(sys.argv) >= 2 and sys.argv[1] == 'test':
print(test())
else:
print(main())
| [
201,
198,
201,
198,
2,
20647,
6337,
25,
3561,
19496,
338,
584,
46768,
201,
198,
2,
3740,
1378,
16302,
68,
18173,
13,
3262,
14,
45573,
28,
3510,
201,
198,
201,
198,
2,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
1241... | 2.136752 | 117 |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
try:
long_description = open("README.md").read()
except IOError:
long_description = ""
setup(
name="ch.zbindenonline.picture",
version="0.0.3a",
description="A library to handle pictures",
license="MIT",
author="Patrick Zb... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
28311,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
1280,
7203,
15675,
11682,
13,
9132,
11074,
961,
... | 2.458484 | 277 |
# -*- coding: utf-8 -*-
"""Tests: Algorithms for shortest paths"""
import unittest
from assertpy import assert_that
from algolib.graphs import DirectedSimpleGraph, UndirectedSimpleGraph
from algolib.graphs.algorithms import Paths, bellman_ford, dijkstra, floyd_warshall
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
51,
3558,
25,
978,
7727,
907,
329,
35581,
13532,
37811,
198,
11748,
555,
715,
395,
198,
198,
6738,
6818,
9078,
1330,
6818,
62,
5562,
198,
198,
6738,
435,
70,
34... | 2.894737 | 95 |
# -*- coding: utf-8 -*-
"""
Ip link command module.
"""
__author__ = 'Julia Patacz'
__copyright__ = 'Copyright (C) 2018, Nokia'
__email__ = 'julia.patacz@nokia.com'
import re
from moler.cmd.unix.genericunix import GenericUnixCommand
from moler.exceptions import ParsingDone
COMMAND_OUTPUT = """
host:~ # ip link sh... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
40,
79,
2792,
3141,
8265,
13,
198,
37811,
198,
198,
834,
9800,
834,
796,
705,
16980,
544,
3208,
330,
89,
6,
198,
834,
22163,
4766,
834,
796,
705,
15269,
... | 1.963483 | 712 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 17 15:06:25 2018
@author: dalonlobo
"""
from __future__ import absolute_import, division, \
print_function, unicode_literals
import os
import sys
import argparse
import logging
import pysrt
import glob
from custom_utils imp... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3300,
2365,
1596,
1315,
25,
3312,
25,
1495,
2864,
198,
198,
31,
9800,
25,
288,
40755,
75,... | 2.433303 | 1,117 |
#!/usr/bin/env python
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy import linalg as sla
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
1330,
300,
1292,
70,
355,
1017,
64,
628
] | 3.026316 | 38 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import github3
from modules.FIC_FileHandler import FICFileHandler
from modules.FIC_DataVault import FICDataVault
from mod... | [
2,
770,
8090,
6127,
5178,
318,
2426,
284,
262,
2846,
286,
262,
29258,
5094,
198,
2,
13789,
11,
410,
13,
362,
13,
15,
13,
1002,
257,
4866,
286,
262,
4904,
43,
373,
407,
9387,
351,
428,
198,
2,
2393,
11,
921,
460,
7330,
530,
379,
... | 2.160409 | 5,673 |
from phylogeny.clocklike_reconstruction import simpledistance | [
6738,
43422,
88,
13,
15750,
2339,
62,
260,
9979,
2762,
1330,
7106,
276,
9311
] | 4.357143 | 14 |
# 导入库
import os
import pandas as pd
os.getcwd()
source_path = os.getcwd() + r'/crawler/yhs_crawler/data/'
# 读入数据
df_1 = pd.read_csv(source_path + 'yhs弹幕.csv', encoding='utf-8', engine='python')
df_1.head(20)
df_1.info()
df_1.shape
| [
2,
10263,
107,
120,
17739,
98,
41753,
241,
198,
11748,
28686,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
418,
13,
1136,
66,
16993,
3419,
198,
198,
10459,
62,
6978,
796,
28686,
13,
1136,
66,
16993,
3419,
1343,
374,
26488,
6... | 1.865079 | 126 |
from enum import Enum
class ConverterType(Enum):
"""
Implments naming for type of convert operations
"""
NONE = 0
CUT = 1
REPLACE = 2
| [
6738,
33829,
1330,
2039,
388,
628,
198,
4871,
35602,
353,
6030,
7,
4834,
388,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
34347,
902,
19264,
329,
2099,
286,
10385,
4560,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
399,
1... | 2.596774 | 62 |
#!/usr/bin/env python
from pyfinder.expr import *
#______________________________________________________________________________
# Poset theory.
element = Sort('element')
le = Function('le', [element, element], BOOL)
a = Variable('a', element)
b = Variable('b', element)
c = Variable('c', element)
theory = Theory... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
12972,
22805,
13,
31937,
1330,
1635,
198,
198,
2,
27193,
2602,
25947,
198,
2,
18574,
316,
4583,
13,
198,
198,
30854,
796,
33947,
10786,
30854,
11537,
198,
198,
293,
796,
155... | 2.727811 | 169 |
# Copyright 2018 IBM. All Rights Reserved.
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | [
2,
15069,
2864,
19764,
13,
1439,
6923,
33876,
13,
198,
2,
15069,
1853,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
19... | 3.900763 | 262 |