content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# Prerequisite: directories for "in_strProtRefsDir" and "sparseData2", should not contain any ".txt" file
# Output: under sparseData2 directory: target.csv, metaInfo.csv, *.txt
import sys
import os
sys.path.append('../..')
import prepLib
in_strFastaFilename = '{!s}/data/protein/plos_HumanEKC/HumanEKC_uniprot-reviewed_... | [
2,
3771,
27614,
25,
29196,
329,
366,
259,
62,
2536,
19703,
8134,
82,
35277,
1,
290,
366,
82,
29572,
6601,
17,
1600,
815,
407,
3994,
597,
27071,
14116,
1,
2393,
198,
2,
25235,
25,
739,
29877,
6601,
17,
8619,
25,
2496,
13,
40664,
11... | 2.62 | 500 |
import numpy as np
import unittest
import discretize
from SimPEG.maps import Wires
from SimPEG.utils import (
mkvc,
WeightedGaussianMixture,
GaussianMixtureWithPrior,
)
from scipy.stats import norm, multivariate_normal
if __name__ == "__main__":
unittest.main()
| [
11748,
299,
32152,
355,
45941,
198,
11748,
555,
715,
395,
198,
11748,
1221,
1186,
1096,
198,
6738,
3184,
47,
7156,
13,
31803,
1330,
370,
2387,
198,
6738,
3184,
47,
7156,
13,
26791,
1330,
357,
198,
220,
220,
220,
33480,
28435,
11,
198,... | 2.728155 | 103 |
from llvmlite import ir, binding
from lang.scope import Scope
from collections import defaultdict
| [
6738,
32660,
85,
4029,
578,
1330,
4173,
11,
12765,
198,
6738,
42392,
13,
29982,
1330,
41063,
198,
6738,
17268,
1330,
4277,
11600,
628
] | 4.304348 | 23 |
from draftjs_exporter.dom import DOM
from wagtail.admin.rich_text.converters import editor_html
from wagtail.admin.rich_text.converters.contentstate_models import Entity
from wagtail.admin.rich_text.converters.html_to_contentstate import AtomicBlockEntityElementHandler
from wagtail.embeds import embeds, format
from wa... | [
6738,
4538,
8457,
62,
1069,
26634,
13,
3438,
1330,
24121,
198,
198,
6738,
266,
363,
13199,
13,
28482,
13,
7527,
62,
5239,
13,
1102,
332,
1010,
1330,
5464,
62,
6494,
198,
6738,
266,
363,
13199,
13,
28482,
13,
7527,
62,
5239,
13,
1102... | 2.79027 | 925 |
# Englishクラスをインポートし、nlpオブジェクトを作成
from ____ import ____
nlp = ____
# テキストを処理
doc = ____("I like tree kangaroos and narwhals.")
# 「tree kangaroors」のスライスを選択
tree_kangaroos = ____
print(tree_kangaroos.text)
# 「tree kangaroos and narwhals」のスライスを選択(「.」は含まない)
tree_kangaroos_and_narwhals = ____
print(tree_kangaroos_and_nar... | [
2,
3594,
14099,
9263,
8943,
31758,
11482,
6527,
1209,
251,
12045,
230,
22180,
23513,
21283,
79,
20513,
24001,
21091,
24806,
14099,
13298,
31758,
43291,
22755,
238,
198,
6738,
220,
1427,
1330,
220,
1427,
198,
198,
21283,
79,
796,
220,
1427... | 1.775401 | 187 |
from causal_world.task_generators.base_task import BaseTask
import numpy as np
| [
6738,
26558,
62,
6894,
13,
35943,
62,
8612,
2024,
13,
8692,
62,
35943,
1330,
7308,
25714,
198,
11748,
299,
32152,
355,
45941,
628,
220,
220,
220,
220
] | 3.111111 | 27 |
from telegram import InputMediaPhoto
from ..language import get_text
from ..database.query import count_occurrence_of_specified_rating
from .buttons import (
get_list_of_buttons,
tamplate_for_show_a_list_of_products,
tamplate_for_show_a_detailed_product)
| [
6738,
573,
30536,
1330,
23412,
13152,
6191,
198,
198,
6738,
11485,
16129,
1330,
651,
62,
5239,
198,
6738,
11485,
48806,
13,
22766,
1330,
954,
62,
13966,
33928,
62,
1659,
62,
23599,
62,
8821,
198,
6738,
764,
4360,
27288,
1330,
357,
198,
... | 2.878788 | 99 |
# -*- coding: utf-8 -*-
#
# This file is part of Sequana software
#
# Copyright (c) 2016-2017 - Sequana Development Team
#
# File author(s):
# Thomas Cokelaer <thomas.cokelaer@pasteur.fr>
#
# Distributed under the terms of the 3-clause BSD license.
# The full license is in the LICENSE file, distributed with t... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
220,
770,
2393,
318,
636,
286,
24604,
2271,
3788,
198,
2,
198,
2,
220,
15069,
357,
66,
8,
1584,
12,
5539,
532,
24604,
2271,
7712,
4816,
198,
2,
198,
2,
... | 2.356749 | 1,993 |
'''Tests the websocket middleware in pulsar.apps.ws.'''
import unittest
import asyncio
from pulsar.api import send
from pulsar.apps.ws import WebSocket, WS
from pulsar.apps.http import HttpClient
from pulsar.apps.test import run_test_server
from examples.websocket.manage import server
| [
7061,
6,
51,
3558,
262,
2639,
5459,
3504,
1574,
287,
22271,
283,
13,
18211,
13,
18504,
2637,
7061,
198,
11748,
555,
715,
395,
198,
11748,
30351,
952,
198,
198,
6738,
22271,
283,
13,
15042,
1330,
3758,
198,
6738,
22271,
283,
13,
18211,... | 3.222222 | 90 |
"""
"""
import app.utils6L.utils6L as utils
import logging
import os
import PySimpleGUI as sg
from app.main.views import view_create_link_address
from app.model import db_session
from app.model.Company import Address, Company
from PySimpleGUI.PySimpleGUI import popup_scrolled
logger_name = os.getenv("LOGGER_NAME")... | [
37811,
198,
37811,
198,
198,
11748,
598,
13,
26791,
21,
43,
13,
26791,
21,
43,
355,
3384,
4487,
198,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
9485,
26437,
40156,
355,
264,
70,
198,
198,
6738,
598,
13,
12417,
13,
33571,
1330,
... | 2.86747 | 166 |
# COUNT CONTAINED PERMUTATIONS
# O(M * U + N) time and O(U) space, where M -> length of big string,
# U -> number of unique characters in small string, N -> length
# of small string.
# U is actually a constant since it can't be greater than 26. and
# M > N, so M will dissolve N
# So, modified complexities:
# O(M) ti... | [
198,
2,
327,
28270,
7102,
30339,
1961,
19878,
44,
3843,
18421,
198,
198,
2,
440,
7,
44,
1635,
471,
1343,
399,
8,
640,
290,
440,
7,
52,
8,
2272,
11,
810,
337,
4613,
4129,
286,
1263,
4731,
11,
198,
2,
471,
4613,
1271,
286,
3748,
... | 3.165217 | 115 |
import urllib.request, json
print(Users.get_user(Users("INfoUpgradersYT")))
| [
11748,
2956,
297,
571,
13,
25927,
11,
33918,
198,
198,
4798,
7,
14490,
13,
1136,
62,
7220,
7,
14490,
7203,
1268,
6513,
4933,
9744,
364,
56,
51,
1,
22305,
198
] | 2.566667 | 30 |
from torch.distributions import constraints
from torch.distributions.exponential import Exponential
from torch.distributions.transformed_distribution import TransformedDistribution
from torch.distributions.transforms import AffineTransform, ExpTransform
from torch.distributions.utils import broadcast_all
class Pareto... | [
6738,
28034,
13,
17080,
2455,
507,
1330,
17778,
198,
6738,
28034,
13,
17080,
2455,
507,
13,
11201,
35470,
1330,
5518,
35470,
198,
6738,
28034,
13,
17080,
2455,
507,
13,
7645,
12214,
62,
17080,
3890,
1330,
3602,
12214,
20344,
3890,
198,
... | 3.106529 | 291 |
from bitmovin.bitmovin_object import BitmovinObject
from .s3_output_service import S3
from .gcs_output_service import GCS
from .akamai_netstorage_output_service import AkamaiNetStorage
from .azure_output_service import Azure
from .ftp_output_service import FTP
from .sftp_output_service import SFTP
from .generic_s3_outp... | [
6738,
1643,
76,
709,
259,
13,
2545,
76,
709,
259,
62,
15252,
1330,
4722,
76,
709,
259,
10267,
198,
6738,
764,
82,
18,
62,
22915,
62,
15271,
1330,
311,
18,
198,
6738,
764,
70,
6359,
62,
22915,
62,
15271,
1330,
402,
7902,
198,
6738,... | 3.164286 | 140 |
#!/usr/bin/env python3
from btcmarkets_api import Market
BTC = Market("/market/BTC/AUD/tick", "BTC")
LTC = Market("/market/LTC/AUD/tick", "LTC")
ETH = Market("/market/ETH/AUD/tick", "ETH")
ETC = Market("/market/ETC/AUD/tick", "ETC")
XRP = Market("/market/XRP/AUD/tick", "XRP")
BCH = Market("/market/BCH/AUD/tick", "BCH"... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
6738,
275,
23047,
34162,
62,
15042,
1330,
5991,
198,
198,
35964,
796,
5991,
7203,
14,
10728,
14,
35964,
14,
48877,
14,
42298,
1600,
366,
35964,
4943,
198,
43,
4825,
796,
5991,
7203... | 2.381215 | 181 |
from funcs.concordance import concordance
def test_concordance_string():
"""
concordance can be called with a string (e.g. a single cell containing a string)
"""
grams = concordance('Hello world. Hello, my great world! Hello Alice and Bob.', 'world')
assert grams == [
('Hello world'),
... | [
6738,
1257,
6359,
13,
1102,
66,
585,
590,
1330,
1673,
585,
590,
628,
198,
4299,
1332,
62,
1102,
66,
585,
590,
62,
8841,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1673,
585,
590,
460,
307,
1444,
351,
257,
4731,
357,
68,... | 2.738281 | 256 |
# -*- coding: utf-8 -*-
import numpy as np
import cv2 as cv
from keras.preprocessing import image
from keras.models import model_from_json
import click
import pandas as pd
from keras.layers import Input
from keras import models
from keras.models import load_model
import pyautogui
import statistics
from PyQt5 import QtW... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
355,
269,
85,
198,
6738,
41927,
292,
13,
3866,
36948,
1330,
2939,
198,
6738,
41927,
292,
13,
27530,
1330,
2746,
... | 2.123537 | 769 |
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
25,
357,
66,
8,
2864,
11,
28038,
856,
4935,
198,
2,
15069,
25,
357,
66,
8,
2864,
11,
2275,
71,
2926,
68,
316,
15035,
2799,
68,
1279,
461,
292,
2799,... | 2.417582 | 91 |
import json
from .models import URL
| [
11748,
33918,
198,
198,
6738,
764,
27530,
1330,
10289,
628
] | 3.8 | 10 |
"""
IN PROGRESS:Transliterating Carlo's routine from Fortran
Form the B-Matrix and C-Matrix used to convert the coordinates
Calcualtes all of the derivaties via finite-difference
define starting xyz geometry.
convention: atom 1 is is 0 0 0
atom 2 bd 0 0
atom 3 on xy plane
"""
# import numpy as np
#
# NATOMS = 10 #... | [
37811,
198,
1268,
38688,
49,
7597,
25,
8291,
17201,
803,
40089,
338,
8027,
422,
6401,
2596,
198,
198,
8479,
262,
347,
12,
46912,
290,
327,
12,
46912,
973,
284,
10385,
262,
22715,
198,
198,
9771,
66,
723,
4879,
477,
286,
262,
16124,
... | 1.706776 | 3,291 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
2,
16529,
1783,
10541,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
5964,
1321,
13,
198,
2,
16529,
1783,
10541,
198,... | 6.089744 | 78 |
n = int(input())
pieces = {}
for _ in range(n):
piece, composer, key = input().split("|")
pieces[piece] = {'composer': composer, 'key': key}
data = input()
while not data == "Stop":
command = data.split("|")
if command[0] == "Add":
piece, composer, key = command[1:]
if piece in piec... | [
77,
796,
493,
7,
15414,
28955,
198,
34154,
796,
23884,
628,
198,
1640,
4808,
287,
2837,
7,
77,
2599,
198,
220,
220,
220,
3704,
11,
26777,
11,
1994,
796,
5128,
22446,
35312,
7203,
91,
4943,
198,
220,
220,
220,
5207,
58,
12239,
60,
... | 2.29636 | 577 |
import insightconnect_plugin_runtime
from .schema import LookupAlertInput, LookupAlertOutput, Input, Output, Component
# Custom imports below
from insightconnect_plugin_runtime.exceptions import PluginException
from komand_recorded_future.util.api import Endpoint
| [
11748,
11281,
8443,
62,
33803,
62,
43282,
198,
6738,
764,
15952,
2611,
1330,
6803,
929,
36420,
20560,
11,
6803,
929,
36420,
26410,
11,
23412,
11,
25235,
11,
35100,
198,
198,
2,
8562,
17944,
2174,
198,
6738,
11281,
8443,
62,
33803,
62,
... | 4.092308 | 65 |
#!/usr/bin/env python3
# Copyright (c) 2020-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test indices in conjunction with prune."""
from test_framework.test_framework import BitcoinTestFramewo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
66,
8,
12131,
12,
1238,
2481,
383,
6185,
7231,
6505,
198,
2,
4307,
6169,
739,
262,
17168,
3788,
5964,
11,
766,
262,
19249,
198,
2,
2393,
27975,
45761,
393,
2638,
... | 3.2 | 155 |
from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
from django.views.generic import TemplateView
from ...models import Commit, UTopic
from ..utils import paginator
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
651,
62,
15252,
62,
273,
62,
26429,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
37350,
7680,
198,
198,
6738,... | 3.678571 | 56 |
from abaqusConstants import *
from .ContactProperty import ContactProperty
class FluidCavityProperty(ContactProperty):
"""The FluidCavityProperty object is an interaction property that defines the fluid
behavior for a surface-based fluid cavity.
The FluidCavityProperty object is derived from the Interact... | [
6738,
450,
30188,
385,
34184,
1187,
1330,
1635,
198,
6738,
764,
17829,
21746,
1330,
14039,
21746,
628,
198,
4871,
1610,
27112,
34,
615,
414,
21746,
7,
17829,
21746,
2599,
198,
220,
220,
220,
37227,
464,
1610,
27112,
34,
615,
414,
21746,... | 2.686129 | 5,515 |
import re
import csv
line = []
list2 = []
with open('output2.txt') as f:
for i in f:
line.append(i)
outList = re.findall(r"[-+]?\d*\.\d+|\d+", line[0]) # extracting integers from string
list2.append(outList[0])
list2.append(outList[2])
#writing into csv file
with open('epoch_loss.csv', 'a... | [
11748,
302,
198,
11748,
269,
21370,
198,
1370,
796,
17635,
198,
4868,
17,
796,
17635,
198,
4480,
1280,
10786,
22915,
17,
13,
14116,
11537,
355,
277,
25,
198,
220,
220,
220,
329,
1312,
287,
277,
25,
198,
220,
220,
220,
220,
197,
1370... | 2.111111 | 207 |
import tornado.web
import tornado.gen
import json
import io
import logging
import motor
from bson.objectid import ObjectId
import mickey.userfetcher
from mickey.basehandler import BaseHandler
| [
11748,
33718,
13,
12384,
198,
11748,
33718,
13,
5235,
198,
11748,
33918,
198,
11748,
33245,
198,
11748,
18931,
198,
198,
11748,
5584,
198,
198,
6738,
275,
1559,
13,
15252,
312,
1330,
9515,
7390,
198,
11748,
12314,
2539,
13,
7220,
34045,
... | 3.730769 | 52 |
import os
import re
# Parses a given input file and returns a list of parameters for all structures.
| [
11748,
28686,
198,
11748,
302,
198,
220,
220,
220,
1303,
23042,
274,
257,
1813,
5128,
2393,
290,
5860,
257,
1351,
286,
10007,
329,
477,
8573,
13,
198
] | 3.888889 | 27 |
from eth_account import Account
import sha3
import json
| [
6738,
4555,
62,
23317,
1330,
10781,
198,
11748,
427,
64,
18,
198,
11748,
33918,
628,
628,
628,
628,
198
] | 3.368421 | 19 |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
_rpi_pcm_ws281x = swig_import_helper()
del swig... | [
2,
770,
2393,
373,
6338,
7560,
416,
12672,
3528,
357,
4023,
1378,
2503,
13,
2032,
328,
13,
2398,
737,
198,
2,
10628,
362,
13,
15,
13,
1065,
198,
2,
198,
2,
2141,
407,
787,
2458,
284,
428,
2393,
4556,
345,
760,
644,
345,
389,
180... | 2.15043 | 698 |
'''
Here we consider a controller trained on nearest neighbor for the pendulum
environment in OpenAI Gym. The controller is taken from baselines ppo.
'''
import gym
import numpy as np
from gym import spaces
from baselines import deepq
from baselines.common import set_global_seeds, tf_util as U
import gym, logging
from... | [
7061,
6,
198,
4342,
356,
2074,
257,
10444,
8776,
319,
16936,
4780,
329,
262,
44017,
14452,
198,
38986,
287,
4946,
20185,
31187,
13,
383,
10444,
318,
2077,
422,
1615,
20655,
279,
7501,
13,
198,
7061,
6,
198,
198,
11748,
11550,
198,
117... | 1.959115 | 4,158 |
import re
from setuptools import setup, find_packages
with open('README.md', 'r', encoding='utf-8') as f:
readme = f.read()
with open('gforms/__init__.py', encoding='utf-8') as f:
version = re.search(r"__version__ = '(.+)'", f.read()).group(1)
setup(
name='gforms',
description='Google Forms wrappe... | [
11748,
302,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
628,
198,
4480,
1280,
10786,
15675,
11682,
13,
9132,
3256,
705,
81,
3256,
21004,
11639,
40477,
12,
23,
11537,
355,
277,
25,
198,
220,
220,
220,
1100,
1326,
796... | 2.392354 | 497 |
import seqcluster.libs.logger as mylog
import os
from seqcluster.libs.classes import annotation, dbannotation
logger = mylog.getLogger("run")
def read_gtf_line(cols, field="name"):
"""parse gtf line to get class/name information"""
field = field.lower()
try:
group = cols[2]
attrs = cols[... | [
11748,
33756,
565,
5819,
13,
8019,
82,
13,
6404,
1362,
355,
616,
6404,
198,
11748,
28686,
198,
198,
6738,
33756,
565,
5819,
13,
8019,
82,
13,
37724,
1330,
23025,
11,
20613,
1236,
14221,
198,
198,
6404,
1362,
796,
616,
6404,
13,
1136,
... | 1.854743 | 2,024 |
pattern()
| [
33279,
3419,
198
] | 3.333333 | 3 |
from __future__ import absolute_import
from __future__ import unicode_literals
import collections
import inspect
import json
import os
import re
from functools import partial
import compose
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
17268,
198,
11748,
10104,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
302,
198,
6738,
1257,
310,
10141... | 3.921569 | 51 |
import numpy as np
from ase.calculators.lj import LennardJones
from ase.units import Bohr, Ha
from pytest import approx, raises
from pygsm.level_of_theories.ase import ASELoT, geom_to_ase, xyz_to_ase
from pygsm.level_of_theories.base_lot import LoTError
xyz_4x4 = [
["H", 1.0, 2.0, 3.0],
["He", 4.0, 5.0, 6.0],... | [
11748,
299,
32152,
355,
45941,
198,
6738,
257,
325,
13,
9948,
3129,
2024,
13,
75,
73,
1330,
28423,
446,
25784,
198,
6738,
257,
325,
13,
41667,
1330,
44366,
81,
11,
9398,
198,
6738,
12972,
9288,
1330,
5561,
11,
12073,
198,
198,
6738,
... | 2.086022 | 186 |
from survey.features.page_objects.base import PageObject
__author__ = 'mnandri'
| [
6738,
5526,
13,
40890,
13,
7700,
62,
48205,
13,
8692,
1330,
7873,
10267,
198,
198,
834,
9800,
834,
796,
705,
10295,
392,
380,
6,
628,
198
] | 3.192308 | 26 |
"""Debug Toolbar Plugin."""
import asyncio
import importlib
import ipaddress as ip
import os.path as op
import re
import sys
import uuid
from muffin import (
Response, StaticRoute, HTTPException, HTTPBadRequest, to_coroutine, HTTPForbidden)
from muffin.plugins import BasePlugin, PluginException
from muffin.utils i... | [
37811,
27509,
16984,
5657,
42636,
526,
15931,
198,
11748,
30351,
952,
198,
11748,
1330,
8019,
198,
11748,
20966,
21975,
355,
20966,
198,
11748,
28686,
13,
6978,
355,
1034,
198,
11748,
302,
198,
11748,
25064,
198,
11748,
334,
27112,
198,
1... | 2.222821 | 4,268 |
import numpy as np
from scipy import stats
import statsmodels.sandbox.stats.runs as runs
# 18/21 output statistics fully implemented from MATLAB, the other three are either from complex helper functions or MATLAB functions that don't transfer well
def PH_Walker(y, walkerRule='prop', walkerParams=np.array([])):
"... | [
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
1330,
9756,
198,
11748,
9756,
27530,
13,
38142,
3524,
13,
34242,
13,
48381,
355,
4539,
198,
198,
2,
1248,
14,
2481,
5072,
7869,
3938,
9177,
422,
36775,
48780,
11,
262,
584,
... | 2.694709 | 3,043 |
from typing import Dict
SKIP = "SKIP"
UNKNOWN = "UNKNOWN!"
def detect_change(first: Dict[str, str], second: Dict[str, str],
compareKeys: [str]) -> bool:
"""Detects change between two dictonaries
Args:
first (Dict[str, str]): First dictionary
second (Dict[str, str]): Second... | [
6738,
19720,
1330,
360,
713,
198,
198,
18831,
4061,
796,
366,
18831,
4061,
1,
198,
4944,
44706,
796,
366,
4944,
44706,
2474,
628,
198,
198,
4299,
4886,
62,
3803,
7,
11085,
25,
360,
713,
58,
2536,
11,
965,
4357,
1218,
25,
360,
713,
... | 2.394636 | 261 |
from . helpers import get_timestamp
| [
6738,
764,
49385,
1330,
651,
62,
16514,
27823,
198
] | 4 | 9 |
from discord.ext import commands
| [
6738,
36446,
13,
2302,
1330,
9729,
628,
198
] | 4.375 | 8 |
import gym
import numpy as np
from PIL import Image
import sys
env = gym.make('Pong-v0')
env.reset()
done = False
i = 0
start = 0
if len(sys.argv) < 3:
print("Usage: collect_pong <games> <start_point>")
exit()
try:
games = int(sys.argv[1])
start = int(sys.argv[2])
i = start
except:
print("Pl... | [
11748,
11550,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
25064,
198,
198,
24330,
796,
11550,
13,
15883,
10786,
47,
506,
12,
85,
15,
11537,
198,
24330,
13,
42503,
3419,
198,
198,
28060,
796,
10352,
... | 2.360963 | 374 |
import random
mylist = []
for somethin in range(1,10):
x = random.randrange(0,9)
mylist.append(x)
print(mylist)
last_index=len(mylist)
print ("length of mylist is:",len(mylist))
print ("first element is:",mylist[0])
print ("last element is:",mylist[len(mylist)-1])
#is mylist sorted?
is_mylist_sorted ... | [
11748,
4738,
198,
198,
1820,
4868,
796,
17635,
198,
198,
1640,
1054,
20079,
287,
2837,
7,
16,
11,
940,
2599,
198,
220,
220,
220,
2124,
796,
4738,
13,
25192,
9521,
7,
15,
11,
24,
8,
198,
220,
220,
220,
616,
4868,
13,
33295,
7,
87... | 2.062791 | 430 |
import os
import setuptools
try: # for pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # for pip <= 9.0.3
from pip.req import parse_requirements
requirements_path = os.path.join(os.path.dirname(__file__), 'requirements.txt')
install_requires = parse_requirements(requirements_... | [
11748,
28686,
201,
198,
11748,
900,
37623,
10141,
201,
198,
28311,
25,
1303,
329,
7347,
18189,
838,
201,
198,
220,
422,
7347,
13557,
32538,
13,
42180,
1330,
21136,
62,
8897,
18883,
201,
198,
16341,
17267,
12331,
25,
1303,
329,
7347,
198... | 2.711165 | 412 |
import pandas as pd
#============== First Round ===================#
#===============================================#
#============== Other Rounds ===================#
#===============================================#
| [
11748,
19798,
292,
355,
279,
67,
198,
198,
2,
25609,
855,
3274,
10485,
36658,
855,
2,
198,
2,
10052,
25609,
18604,
2,
198,
220,
220,
220,
220,
198,
198,
2,
25609,
855,
3819,
49049,
36658,
855,
2,
198,
2,
10052,
25609,
18604,
2,
19... | 5.136364 | 44 |
"""
Exercício 03
Peça ao usuário para digitar 3 valores inteiros e imprima a soma deles.
"""
print('Digite três números inteiros para somá-los:\n')
num1 = int(float(input('Primeiro número: ').replace(',', '.')))
num2 = int(float(input('Segundo número: ').replace(',', '.')))
num3 = int(float(input('Terceiro número: ').... | [
37811,
198,
3109,
2798,
8836,
66,
952,
7643,
198,
6435,
50041,
257,
78,
514,
84,
6557,
27250,
31215,
3100,
7940,
513,
1188,
2850,
493,
20295,
4951,
304,
848,
3036,
64,
257,
3870,
64,
390,
829,
13,
198,
37811,
198,
198,
4798,
10786,
... | 2.369942 | 173 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
module_definition = json.loads(
"""{
"family": "discovery",
"name": "discovery_network_device",
"operations": {
"get": [
"get_discovered_network_devices_by_discovery_id",
... | [
6738,
11593,
37443,
834,
1330,
357,
48546,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
8,
198,
834,
4164,
330,
31172,
834,
796,
2099,
198,
11748,
33918,
198,
198,
21412,
62,
46758,
796,
33918,
13,
46030,
7,
198,
220,
220,
220,
37227,
9... | 1.549853 | 2,728 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
from lib.bucket import BUCKET_ID
from lib.subcommand import SubCommand
| [
2,
15069,
2211,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
198,
11748... | 3.686567 | 67 |
burst_time=[]
print("Enter the number of process: ")
n=int(input())
print("Enter the burst time of the processes: \n")
burst_time=list(map(int, input().split()))
waiting_time=[]
avg_waiting_time=0
turnaround_time=[]
avg_turnaround_time=0
waiting_time.insert(0,0)
turnaround_time.insert(0,burst_time[0])
for i ... | [
31961,
62,
2435,
28,
21737,
201,
198,
4798,
7203,
17469,
262,
1271,
286,
1429,
25,
366,
8,
201,
198,
77,
28,
600,
7,
15414,
28955,
201,
198,
4798,
7203,
17469,
262,
11173,
640,
286,
262,
7767,
25,
3467,
77,
4943,
201,
198,
31961,
... | 2.368039 | 413 |
import os
from airflow.hooks.base_hook import BaseHook
from airflow.operators.bash_operator import BashOperator
from airflow.utils.decorators import apply_defaults
| [
11748,
28686,
198,
198,
6738,
45771,
13,
25480,
82,
13,
8692,
62,
25480,
1330,
7308,
39,
566,
198,
6738,
45771,
13,
3575,
2024,
13,
41757,
62,
46616,
1330,
15743,
18843,
1352,
198,
6738,
45771,
13,
26791,
13,
12501,
273,
2024,
1330,
4... | 3.608696 | 46 |
"""
Author: Haoyin Xu
"""
import time
import psutil
import argparse
import numpy as np
import torchvision.datasets as datasets
from numpy.random import permutation
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from river import tree
from skgarden import MondrianFore... | [
37811,
198,
13838,
25,
9398,
726,
259,
33591,
198,
37811,
198,
11748,
640,
198,
11748,
26692,
22602,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
10178,
13,
19608,
292,
1039,
355,
40522,
198,
6738,
299,
... | 1.891149 | 7,129 |
"""Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
# Modified by Sophie Kirschner
# https://github.com/python/cpython/blob/master/Lib/textwrap.py
# https://github.com/python/cpython/blob/master/L... | [
37811,
8206,
27074,
290,
12591,
13,
198,
37811,
198,
198,
2,
15069,
357,
34,
8,
7358,
12,
14585,
20653,
350,
13,
12150,
13,
198,
2,
15069,
357,
34,
8,
6244,
11,
5816,
11361,
10442,
5693,
13,
198,
2,
22503,
416,
8547,
12150,
1279,
... | 2.520575 | 4,034 |
# Copyright 2014 Red Hat, 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 a... | [
2,
220,
220,
220,
15069,
1946,
2297,
10983,
11,
3457,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
428,
2393,
... | 3.268852 | 305 |
from PIL import Image
from PIL.ExifTags import TAGS
import exifread
import re
import json
def get_exif_data(fname):
"""Get embedded EXIF data from image file."""
ret = {}
try:
img = Image.open(fname)
if hasattr( img, '_getexif' ):
exifinfo = img._getexif()
if exifin... | [
6738,
350,
4146,
1330,
7412,
198,
6738,
350,
4146,
13,
3109,
361,
36142,
1330,
37801,
50,
198,
11748,
409,
361,
961,
198,
11748,
302,
198,
198,
11748,
33918,
198,
198,
4299,
651,
62,
1069,
361,
62,
7890,
7,
69,
3672,
2599,
198,
220,... | 2.049383 | 324 |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_bootstrap import Bootstrap
from flask_login import LoginManager
from flask_moment import Moment
from flask_mail import Mail
# from flask_mail_sendgrid import MailSendGrid
from config import Config
from logging.h... | [
6738,
42903,
1330,
46947,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
42903,
62,
76,
42175,
1330,
337,
42175,
198,
6738,
42903,
62,
18769,
26418,
1330,
18892,
26418,
198,
6738,
42903,
62,
38235,
1330,
230... | 3.824818 | 137 |
'''
File: test_conversions.py
Author: Adam Pah
Description:
py.test test ensemble
'''
import pytest
import conversions as conv
class TestConvertTimeseries:
'''
Covers the convert_timeseries_to_intervalseries function
'''
timeseries = [[0, 2], [2, 3], [5, 3]]
def test_basic(self):
'''
... | [
7061,
6,
198,
8979,
25,
1332,
62,
1102,
47178,
13,
9078,
198,
13838,
25,
7244,
350,
993,
198,
11828,
25,
220,
198,
9078,
13,
9288,
1332,
34549,
198,
7061,
6,
198,
11748,
12972,
9288,
198,
11748,
32626,
355,
3063,
198,
198,
4871,
620... | 2.413379 | 583 |
from django.urls import reverse
from extforms.deprecated_forms import SWCEventRequestForm, DCEventRequestForm
from extrequests.models import (
EventRequest,
)
from workshops.models import Event, Organization
from workshops.tests.base import TestBase
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
198,
6738,
1070,
23914,
13,
10378,
31023,
62,
23914,
1330,
12672,
5222,
1151,
18453,
8479,
11,
360,
5222,
1151,
18453,
8479,
198,
6738,
1070,
8897,
3558,
13,
27530,
1330,
357,
198,
220,... | 3.73913 | 69 |
"""
Our HADS database gets loaded up with duplicates, this cleans it up.
called from RUN_MIDNIGHT.sh
"""
from __future__ import print_function
import datetime
import sys
import pytz
from pyiem.util import get_dbconn, utc
def query(sql, args=None):
"""
Do a query and make it atomic
"""
pgconn = get... | [
37811,
198,
3954,
367,
47149,
6831,
3011,
9639,
510,
351,
14184,
16856,
11,
428,
20658,
340,
510,
13,
628,
1444,
422,
32494,
62,
44,
2389,
45,
9947,
13,
1477,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,... | 2.310377 | 1,060 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
220,
198
] | 3.1 | 10 |
import numpy as np
import os
import pickle
#128x128
####################################################
'''
Inputs 128x128 pixel array
Returns label where:
label 0 = 1
label 1 = 2
etc
'''
'''
returns an array of arrays, each one is the data from one image
'''
###########################################
# ... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
2,
12762,
87,
12762,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
29113,
14468,
4242,
198,
7061,
6,
198,
20560,
82,
13108,
87,
12762,
17465,
7177,
198,... | 2.482667 | 375 |
# -*- coding: utf-8 -*-
"""Python implementation of the StalinSort algorithm.
References
----------
- :cite:`mathew` : @mathew@mastodon.social (2018/10/26 04:20:16)
''I came up with a single pass O(n) sort algorithm I call StalinSort. You
iterate down the list of elements checking if they're in order. Any e... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
37906,
7822,
286,
262,
17482,
42758,
11862,
13,
198,
198,
19927,
198,
35937,
198,
12,
220,
220,
1058,
66,
578,
25,
63,
6759,
6391,
63,
1058,
2488,
6759,
63... | 2.729249 | 506 |
import matplotlib.pyplot as plt
import numpy as np
from pyfmi import load_fmu
model = load_fmu('./PadeSlave.fmu')
inputs = ('inputVariable', lambda t: 5. * np.cos(t))
simulation = model.simulate(final_time=30, input=inputs)
plt.plot(simulation['time'], simulation['inputVariable'])
plt.plot(simulation['time'], simula... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
12972,
69,
11632,
1330,
3440,
62,
69,
30300,
198,
198,
19849,
796,
3440,
62,
69,
30300,
7,
4458,
14,
47,
671,
11122,
1015,
13,
6... | 2.711538 | 156 |
# Requirements:
# - fmtc
# - nnedi3
# From:
# - https://github.com/mawen1250/VapourSynth-script
# - https://github.com/HomeOfVapourSynthEvolution/mvsfunc
import vapoursynth as vs
import math
## Gamma conversion functions from HAvsFunc-r18
# Convert the luma channel to linear light
# Convert back a clip t... | [
2,
24422,
25,
198,
2,
220,
220,
532,
46996,
66,
198,
2,
220,
220,
532,
299,
2817,
72,
18,
198,
2,
3574,
25,
198,
2,
220,
220,
532,
3740,
1378,
12567,
13,
785,
14,
76,
707,
268,
1065,
1120,
14,
53,
499,
454,
29934,
400,
12,
1... | 3.018182 | 165 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-03-17 17:29
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
24,
13,
22,
319,
2177,
12,
3070,
12,
1558,
1596,
25,
1959,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.719298 | 57 |
import numpy as np
import EZ.stderr as stderr
| [
11748,
299,
32152,
355,
45941,
198,
11748,
412,
57,
13,
301,
1082,
81,
355,
336,
1082,
81,
628,
628,
628,
628,
628
] | 2.5 | 22 |
from PyQt5 import QtGui, QtCore, QtWidgets
from collections import namedtuple
import time
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
from utils import utils
HumanFeedback = namedtuple('HumanFeedback', ['feedback_value'])
SavedAction = namedtuple('SavedAction', ['state', 'action', ... | [
6738,
9485,
48,
83,
20,
1330,
33734,
8205,
72,
11,
33734,
14055,
11,
33734,
54,
312,
11407,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
11748,
640,
198,
11748,
4738,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198... | 3.142857 | 140 |
import sys, random, string, time
rawBoard = ''
moves = 0
# size -> int
# generate board of size size x size filled with random chars
# @returns none
# textFile -> string
# loads a board from a text file
# @returns board in 2D list form
# board -> 2D array
# prints out the bogal board
# coordinate -> ... | [
11748,
25064,
11,
4738,
11,
4731,
11,
640,
201,
198,
201,
198,
1831,
29828,
796,
10148,
201,
198,
76,
5241,
796,
657,
201,
198,
2,
2546,
4613,
493,
201,
198,
2,
7716,
3096,
286,
2546,
2546,
2124,
2546,
5901,
351,
4738,
34534,
201,
... | 3.196491 | 285 |
myFunc("That's neat")
| [
198,
1820,
37,
19524,
7203,
2504,
338,
15049,
4943,
198
] | 2.3 | 10 |
import logging
import os
from netmiko import ConnectHandler
from paramiko import AutoAddPolicy, SSHClient
from routeros_diff.parser import RouterOSConfig
from scp import SCPClient
| [
11748,
18931,
198,
11748,
28686,
198,
198,
6738,
2010,
76,
12125,
1330,
8113,
25060,
198,
6738,
5772,
12125,
1330,
11160,
4550,
36727,
11,
33825,
11792,
198,
6738,
20264,
418,
62,
26069,
13,
48610,
1330,
48538,
2640,
16934,
198,
6738,
629... | 3.895833 | 48 |
import pytest_pydocstyle
# https://docs.pytest.org/en/5.2.2/writing_plugins.html#testing-plugins
pytest_plugins = ["pytester"]
| [
11748,
12972,
9288,
62,
79,
5173,
420,
7635,
198,
198,
2,
3740,
1378,
31628,
13,
9078,
9288,
13,
2398,
14,
268,
14,
20,
13,
17,
13,
17,
14,
16502,
62,
37390,
13,
6494,
2,
33407,
12,
37390,
198,
9078,
9288,
62,
37390,
796,
14631,
... | 2.555556 | 54 |
from peewee import *
import peeweedbevolve
from models_data import Tweet, Branch, calldb
db = calldb()
create_tables()
| [
6738,
613,
413,
1453,
1330,
1635,
198,
11748,
613,
413,
2308,
1350,
85,
6442,
198,
198,
6738,
4981,
62,
7890,
1330,
18752,
11,
20551,
11,
2386,
335,
65,
198,
198,
9945,
796,
2386,
335,
65,
3419,
628,
198,
17953,
62,
83,
2977,
3419,
... | 2.795455 | 44 |
import json
import base64
from rest_framework import status
from rest_framework.test import APITestCase
from rest_framework.authtoken.models import Token
from .models import User
# Create your tests here.
ACCEPT_STATUS = "A"
REJECT_STATUS = "R"
UNFRIEND_STATUS = "R"
| [
11748,
33918,
198,
11748,
2779,
2414,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
3486,
2043,
395,
20448,
198,
6738,
1334,
62,
30604,
13,
18439,
30001,
13,
27530,
1330,
29130,
198,
6738,
764,
2753... | 3.176471 | 85 |
# -*- coding: utf-8 -*-
################################################################################
# Copyright (C) 2009 Travis Shirk <travis@pobox.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free So... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
29113,
29113,
14468,
198,
2,
220,
15069,
357,
34,
8,
3717,
220,
19804,
911,
14232,
1279,
83,
16956,
31,
79,
672,
1140,
13,
785,
29,
198,
2,
198,
2,
220,
770,
1430,
... | 3.66474 | 346 |
# -*- coding: utf-8 -*-
"""Clothing_Recommender Project .ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1nw0ewNdkx8o3WULAp2ynhHpbq1kVq7YZ
Clean the data and use input
"""
## Import and Organize Data ##
import pandas as pd
import numpy as np
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
2601,
24834,
62,
24898,
2194,
4935,
764,
541,
2047,
65,
198,
198,
38062,
4142,
7560,
416,
1623,
4820,
2870,
13,
198,
198,
20556,
2393,
318,
5140,
379,
198,
220,
... | 3.056377 | 1,082 |
from rtree.index import Rtree
from src.features.helper import *
import sys
import logging
import time
if __name__ == '__main__':
train_data = sys.argv[1]
q_size = int(sys.argv[2])
main(train_data, q_size)
| [
6738,
374,
21048,
13,
9630,
1330,
371,
21048,
198,
6738,
12351,
13,
40890,
13,
2978,
525,
1330,
1635,
198,
11748,
25064,
198,
11748,
18931,
198,
11748,
640,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
... | 2.528736 | 87 |
from app import app
import logging
logging.basicConfig(level=logging.WARNING)
if __name__ == "__main__":
app.debug = True
app.run() | [
6738,
598,
1330,
598,
198,
11748,
18931,
198,
198,
6404,
2667,
13,
35487,
16934,
7,
5715,
28,
6404,
2667,
13,
31502,
8,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
598,
13,
24442,
796,
6407... | 2.764706 | 51 |
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RAffypdnn(RPackage):
"""The package contains functions to perform the PDNN method
desc... | [
2,
15069,
2211,
12,
7908,
13914,
45036,
3549,
2351,
4765,
11,
11419,
290,
584,
198,
2,
1338,
441,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
27975,
38162,
9947,
2393,
329,
3307,
13,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
33234,
... | 2.633065 | 248 |
#######################################################################
"""
@author: Emanuele Musumeci (https://github.com/EmanueleMusumeci)
PopulationInitializer abstract class and basic initializer that generates
a population of random binary strings of a given length
"""
######################################... | [
29113,
29113,
4242,
21017,
198,
37811,
198,
2488,
9800,
25,
412,
805,
518,
293,
2629,
388,
721,
72,
357,
5450,
1378,
12567,
13,
785,
14,
36,
805,
518,
293,
10694,
388,
721,
72,
8,
220,
198,
220,
198,
20133,
24243,
7509,
12531,
1398,... | 4.417178 | 163 |
import os
import subprocess
from .utils import checkdir, get_condor_version, requires_command
from .basenode import BaseNode
from .job import Job
def _iter_job_args(job):
"""
Iterates over Job args list. Yields the name (and JobArg) for each node
to be used when adding job to a Dagman (i.e. the name in... | [
198,
11748,
28686,
198,
11748,
850,
14681,
198,
198,
6738,
764,
26791,
1330,
2198,
15908,
11,
651,
62,
17561,
273,
62,
9641,
11,
4433,
62,
21812,
198,
6738,
764,
12093,
268,
1098,
1330,
7308,
19667,
198,
6738,
764,
21858,
1330,
15768,
... | 2.207223 | 5,815 |
"""
Module containing a numpy-like array which supports lazy reading of tiled 2D-image data.
"""
import abc
import dask.array as da
import numpy as np
class LazyArray:
"""
An abstract class of a numpy-like array which supports lazy reading of tiled 2D-image data.
The class represents a custom array contai... | [
37811,
198,
26796,
7268,
257,
299,
32152,
12,
2339,
7177,
543,
6971,
16931,
3555,
286,
256,
3902,
362,
35,
12,
9060,
1366,
13,
198,
37811,
198,
11748,
450,
66,
198,
11748,
288,
2093,
13,
18747,
355,
12379,
198,
11748,
299,
32152,
355,... | 2.209539 | 1,866 |
from django.core.management.base import BaseCommand
from core.datatools.fail_repeat import FailRepeater
| [
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
198,
198,
6738,
4755,
13,
19608,
265,
10141,
13,
32165,
62,
44754,
1330,
18448,
47541,
729,
628
] | 3.655172 | 29 |
from typing import Dict
import requests
from config.env import starhubtvplus_app_key, starhubtvplus_client_uuid
| [
6738,
19720,
1330,
360,
713,
198,
11748,
7007,
198,
6738,
4566,
13,
24330,
1330,
3491,
40140,
14981,
9541,
62,
1324,
62,
2539,
11,
3491,
40140,
14981,
9541,
62,
16366,
62,
12303,
312,
628
] | 3.424242 | 33 |
#
# Import section
#
import numpy
from syned.beamline.beamline_element import BeamlineElement
from syned.beamline.element_coordinates import ElementCoordinates
from wofry.propagator.propagator import PropagationManager, PropagationElements, PropagationParameters
from wofry.propagator.wavefront1D.generic_wavefront imp... | [
2,
198,
2,
17267,
2665,
198,
2,
198,
11748,
299,
32152,
198,
198,
6738,
827,
2817,
13,
40045,
1370,
13,
40045,
1370,
62,
30854,
1330,
25855,
1370,
20180,
198,
6738,
827,
2817,
13,
40045,
1370,
13,
30854,
62,
37652,
17540,
1330,
11703,... | 2.184335 | 1,481 |
import unittest
from models import Marker # for Marker.bounding_box_query
import datetime
# This tests year 2014 accidents as this is the current example git data for testing
# Once this changes to another year or to the current year's accidents (as should be) un-comment lines 11,13,15
# and change both 2014 and 2015... | [
11748,
555,
715,
395,
198,
6738,
4981,
1330,
2940,
263,
220,
1303,
329,
2940,
263,
13,
7784,
278,
62,
3524,
62,
22766,
198,
11748,
4818,
8079,
198,
198,
2,
770,
5254,
614,
1946,
17390,
355,
428,
318,
262,
1459,
1672,
17606,
1366,
32... | 2.778182 | 275 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
33448,
3012,
11419,
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,
733... | 2.170121 | 1,158 |
""" Longest Palindromic Subsequence
Given a string s, find the longest palindromic subsequence's length in s.
A subsequence is a sequence that can be derived from another sequence by
deleting some or no elements without changing the order of the remaining elements.
- Example 1:
- Input: s = "bbbab"
- Output:... | [
37811,
5882,
395,
3175,
521,
398,
291,
3834,
43167,
198,
198,
15056,
257,
4731,
264,
11,
1064,
262,
14069,
6340,
521,
398,
291,
6399,
594,
338,
4129,
287,
264,
13,
198,
198,
32,
6399,
594,
318,
257,
8379,
326,
460,
307,
10944,
422,
... | 3.244755 | 286 |
import statistics
data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]
print(statistics.mean(data)) # 平均
print(statistics.median(data)) # 中央値
print(statistics.variance(data)) # 標本標準分散
| [
11748,
7869,
198,
7890,
796,
685,
17,
13,
2425,
11,
352,
13,
2425,
11,
352,
13,
1495,
11,
657,
13,
1495,
11,
657,
13,
20,
11,
352,
13,
1495,
11,
513,
13,
20,
60,
198,
4798,
7,
14269,
3969,
13,
32604,
7,
7890,
4008,
1303,
10263... | 1.826531 | 98 |
# Copyright 2021 Joshua Watt <JPEWhacker@gmail.com>
#
# SPDX-License-Identifier: MIT
| [
2,
15069,
33448,
20700,
30263,
1279,
41,
11401,
1199,
10735,
31,
14816,
13,
785,
29,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
628
] | 2.965517 | 29 |
from django.db import models
from django.contrib.auth.models import User
from ckeditor_uploader.fields import RichTextUploadingField
# Create your models here.
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
269,
9091,
2072,
62,
25850,
263,
13,
25747,
1330,
3998,
8206,
41592,
278,
15878,
198,
198,
2,
13610,
534,
... | 3.367347 | 49 |
import os
from django import forms
from django.utils.translation import gettext_lazy as _
from wagtail.admin.widgets import AdminPageChooser
from wagtail.contrib.redirects.models import Redirect
from wagtail.models import Site
| [
11748,
28686,
198,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
355,
4808,
198,
198,
6738,
266,
363,
13199,
13,
28482,
13,
28029,
11407,
1330,
32053,
9876,
22164,
13... | 3.362319 | 69 |
import numpy as np
import cv2
import copy
from Tkinter import *
from PIL import Image
from PIL import ImageTk
import tkFileDialog
root = Tk()
panelA = None
panelB = None
img = None
img2 = None
img3 = None
ConvolutionLabel = Label(root, text="Convolute").grid(row=0,column=0)
Conv00Entry = Entry(root, bd =5)
Conv01Ent... | [
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
4866,
198,
6738,
309,
74,
3849,
1330,
1635,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
350,
4146,
1330,
7412,
51,
74,
198,
11748,
256,
74,
8979,
44204,
628,
198,
... | 2.564453 | 1,024 |
#-------------------------------------------------------------------------------
# Post processing (color management) related Mari scripts
# coding: utf-8
# Copyright (c) 2011 The Foundry Visionmongers Ltd. All Rights Reserved.
#-------------------------------------------------------------------------------
import ma... | [
2,
10097,
24305,
198,
2,
2947,
7587,
357,
8043,
4542,
8,
3519,
29423,
14750,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
357,
66,
8,
2813,
383,
4062,
563,
19009,
31059,
364,
12052,
13,
220,
1439,
6923,
33876,
13,
198,
2,
... | 6.726295 | 1,023 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import shutil
from pathlib import Path
from libcst.testing.utils import UnitTest
from fixit.common.config import (
CACHE as CO... | [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,
262,
6808,
8619,
286,
428,
2723,
5509,
13,
198,
... | 2.800623 | 321 |
"""
Announce addresses as they are received from other hosts
"""
import Queue
import state
from helper_random import randomshuffle
from network.assemble import assemble_addr
from network.connectionpool import BMConnectionPool
from queues import addrQueue
from threads import StoppableThread
class AddrThread(Stoppable... | [
37811,
198,
18858,
8652,
9405,
355,
484,
389,
2722,
422,
584,
11453,
198,
37811,
198,
11748,
4670,
518,
198,
198,
11748,
1181,
198,
6738,
31904,
62,
25120,
1330,
4738,
1477,
18137,
198,
6738,
3127,
13,
292,
15140,
1330,
25432,
62,
29851... | 4.03 | 100 |
print("branches are fun") | [
4798,
7203,
1671,
12140,
389,
1257,
4943
] | 3.571429 | 7 |
from django import template
register = template.Library()
@register.filter(name='addcss')
| [
6738,
42625,
14208,
1330,
11055,
198,
198,
30238,
796,
11055,
13,
23377,
3419,
198,
198,
31,
30238,
13,
24455,
7,
3672,
11639,
2860,
25471,
11537,
628,
628
] | 3.518519 | 27 |
# -*- coding: utf-8 -*-
vars2d = [
'2m_temperature',
'10m_u_component_of_wind', '10m_v_component_of_wind',
'total_cloud_cover', 'total_precipitation',
'toa_incident_solar_radiation',
'temperature_850hPa',
]
vars3d = [
'geopotential', 'temperature',
'specific_humidity', 'relative_humidity',... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
85,
945,
17,
67,
796,
685,
198,
220,
220,
220,
705,
17,
76,
62,
11498,
21069,
3256,
198,
220,
220,
220,
705,
940,
76,
62,
84,
62,
42895,
62,
1659,
62,
7972,
... | 2.08589 | 652 |
# -*- coding: utf-8 -*-
"""
StepPy
:copyright: (c) 2016-2017 by Yann Gravrand.
:license: BSD, see LICENSE for more details.
"""
from collections import OrderedDict
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
5012,
20519,
198,
220,
220,
220,
1058,
22163,
4766,
25,
357,
66,
8,
1584,
12,
5539,
416,
575,
1236,
32599,
25192,
13,
198,
220,
220,
220,
... | 2.542857 | 70 |