content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import HelloApiView, HelloViewSet, UserProfileViewSet, UserLoginApiView, UserProfileFeedView
router = DefaultRouter()
router.register('hello-viewset', HelloViewSet, basename = 'hello-viewset')
router.register('profile',... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
198,
6738,
1334,
62,
30604,
13,
472,
1010,
1330,
15161,
49,
39605,
198,
198,
6738,
764,
33571,
1330,
18435,
32,
14415,
7680,
11,
18435,
7680,
7248,
11,
11787,
37046,
7680,
7248,
... | 3.043716 | 183 |
import os
import yaml
import numpy as np
import pandas as pd
from env_variables.env_variables import TOKEN,\
RESOURCE_ID,\
PICSURE_NETWORK_URL
from python_lib.querying_hpds import get_HPDS_connection,\
get_whole_dic, \
get_studies_dictionary, \
get_batch_groups, \
query_runner
with open("env_... | [
11748,
28686,
198,
11748,
331,
43695,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
17365,
62,
25641,
2977,
13,
24330,
62,
25641,
2977,
1330,
5390,
43959,
11,
59,
198,
220,
220,
220,
15... | 2.282373 | 1,753 |
# #!/usr/bin/python3
# coding: UTF-8
# もしくは #!/usr/bin/env python など環境に合わせて
#2022.02.05 UDP通信動作は安定。
#2022.02.05 COMMAND WINDOWのPOWERチェックボックスでサーボ電源ON
#2022.02.05 上記サーボ電源ON中にスライドバー操作でサーボ動作(ただしスライドバーが小さいため大まかな動作確認のみに利用可)
import numpy as np
import socket
from contextlib import closing
import struct
import math
import de... | [
2,
1303,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
19617,
25,
41002,
12,
23,
198,
2,
17433,
224,
22180,
31917,
31676,
5099,
222,
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
23294,
103,
2515,
102,
163,
240,
108,
161,
95,
225,
... | 1.731196 | 811 |
"""
Copyright BOOSTRY Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distr... | [
37811,
198,
15269,
347,
6684,
2257,
18276,
1766,
1539,
12052,
13,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
1... | 2.394276 | 4,053 |
import sublime_plugin
from live.sublime.edit import edit_for
from live.common.method import call_next
from live.common.method import method
from live.common.misc import mapping_key_set
| [
11748,
41674,
62,
33803,
198,
198,
6738,
2107,
13,
7266,
27299,
13,
19312,
1330,
4370,
62,
1640,
198,
6738,
2107,
13,
11321,
13,
24396,
1330,
869,
62,
19545,
198,
6738,
2107,
13,
11321,
13,
24396,
1330,
2446,
198,
6738,
2107,
13,
1132... | 3.666667 | 51 |
import os
import logging
import argparse
import matplotlib.pyplot as plt
from lstmcpipe.plots.plot_irfs import plot_summary_from_file
parser = argparse.ArgumentParser(description="Produce IRFs comparative plots")
# Required arguments
parser.add_argument('--filelist', '-f',
type=str,
... | [
11748,
28686,
198,
11748,
18931,
198,
11748,
1822,
29572,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
300,
301,
76,
13155,
3757,
13,
489,
1747,
13,
29487,
62,
343,
9501,
1330,
7110,
62,
49736,
62,
6738,
62... | 2.034853 | 373 |
from collections import deque
| [
6738,
17268,
1330,
390,
4188,
198
] | 5 | 6 |
# python 3.7
# -*- coding: utf-8 -*-
import sys
from gensim.models.keyedvectors import KeyedVectors
import numpy as np
import pandas as pd
from datetime import datetime
import time
from threading import Thread
from multiprocessing import Process
import multiprocessing
# # load pre-train model on my own corpus
# mod... | [
2,
21015,
513,
13,
22,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
25064,
198,
6738,
308,
641,
320,
13,
27530,
13,
2539,
276,
303,
5217,
1330,
7383,
276,
53,
478,
669,
198,
11748,
299,
32152,
... | 2.723944 | 710 |
# coding:utf-8
from . import api
from ihome import db
# 导入打印日志的api
import logging
from flask import current_app
@api.route('/')
| [
2,
19617,
25,
40477,
12,
23,
198,
6738,
764,
1330,
40391,
198,
6738,
1312,
11195,
1330,
20613,
198,
198,
2,
10263,
107,
120,
17739,
98,
33699,
241,
39355,
108,
33768,
98,
33232,
245,
21410,
15042,
198,
11748,
18931,
198,
6738,
42903,
... | 2.357143 | 56 |
# SPDX-FileCopyrightText: 2020 Bryan Siepert, written for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
# pylint:disable=no-member
import board
import busio
from adafruit_tla202x import TLA2024, Mux
i2c = busio.I2C(board.SCL, board.SDA)
tla = TLA2024(i2c)
for i in range(4):
channel = i
... | [
2,
30628,
55,
12,
8979,
15269,
8206,
25,
12131,
17857,
48931,
11766,
11,
3194,
329,
1215,
1878,
4872,
20171,
201,
198,
2,
201,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
791,
43085,
201,
198,
2,
279,
2645,
600,
25,
40223,
... | 1.783866 | 657 |
# Copyright 2020-2021 VMware, Inc.
# SPDX-License-Identifier: MIT
from os.path import dirname, abspath
import logging
dir_path = dirname(abspath(__file__))
parent_dir_path = dirname(dir_path)
global_args = {
"server-ip": "0.0.0.0",
"port": 3000,
"domain_file_path": dir_path + "/utils/ads_domain.txt", #pat... | [
2,
15069,
12131,
12,
1238,
2481,
37754,
11,
3457,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
1849,
36393,
198,
6738,
28686,
13,
6978,
1330,
26672,
3672,
11,
2352,
6978,
198,
11748,
18931,
198,
198,
15908,
62,
6978,
796,
... | 2.774757 | 515 |
import pandas as pd
from autoscalingsim.utils.price import PricePerUnitTime
from autoscalingsim.utils.credits import CreditsPerUnitTime
from .node import NodeInfo
class ProviderNodes:
""" Bundles information about the nodes of a particular provider """
class ProviderNodesIterator:
""" Iterator class for P... | [
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
44619,
9948,
654,
320,
13,
26791,
13,
20888,
1330,
7886,
5990,
26453,
7575,
198,
6738,
44619,
9948,
654,
320,
13,
26791,
13,
66,
20696,
1330,
29501,
5990,
26453,
7575,
198,
198,
6738,
7... | 3.703297 | 91 |
import numpy as np
import math
from collections import namedtuple
import sys
from graphviz import Digraph
# import visualize
# import genotypes as gt
Genotype = namedtuple('Genotype', 'normal normal_concat reduce reduce_concat')
def plot(genotype, file_path, caption=None):
""" make DAG plot and save to file_path... | [
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
11748,
25064,
198,
6738,
4823,
85,
528,
1330,
7367,
1470,
198,
198,
2,
1330,
38350,
198,
2,
1330,
2429,
13567,
355,
308,
83,
198,
13746,
8... | 1.829167 | 1,200 |
from OpenGL.raw.GLES3._types import *
from OpenGL.GLES3.VERSION.GLES3_3_0 import *
| [
6738,
30672,
13,
1831,
13,
8763,
1546,
18,
13557,
19199,
1330,
1635,
201,
198,
6738,
30672,
13,
8763,
1546,
18,
13,
43717,
13,
8763,
1546,
18,
62,
18,
62,
15,
1330,
1635,
201,
198
] | 2.5 | 34 |
from django.core.exceptions import ObjectDoesNotExist
from main.strategy.indicators import AVERAGE_METHODS, INDICATOR_METHODS
from trades.models import OrderTask
from prices.interface import prices_get | [
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
9515,
13921,
3673,
3109,
396,
198,
198,
6738,
1388,
13,
2536,
4338,
13,
521,
44549,
1330,
317,
5959,
11879,
62,
49273,
50,
11,
24413,
2149,
25633,
62,
49273,
50,
198,
6738,
17674,
1... | 3.625 | 56 |
# Copyright (c) 2017 Civic Knowledge. This file is licensed under the terms of the
# Revised BSD License, included in this distribution as LICENSE
"""
Common support for jupyter notebooks.
"""
import nbformat
from contextlib import contextmanager
from os.path import join, dirname
from os import makedirs
import logging... | [
2,
15069,
357,
66,
8,
2177,
31593,
20414,
13,
770,
2393,
318,
11971,
739,
262,
2846,
286,
262,
198,
2,
31492,
347,
10305,
13789,
11,
3017,
287,
428,
6082,
355,
38559,
24290,
198,
198,
37811,
198,
17227,
1104,
329,
474,
929,
88,
353,... | 2.568456 | 1,490 |
import numpy as np
from kaggle_environments import make
from kaggle_environments.envs.hungry_geese.hungry_geese import Configuration, Observation, Action, adjacent_positions
| [
11748,
299,
32152,
355,
45941,
198,
6738,
479,
9460,
293,
62,
268,
12103,
1330,
787,
198,
6738,
479,
9460,
293,
62,
268,
12103,
13,
268,
14259,
13,
43274,
563,
62,
469,
2771,
13,
43274,
563,
62,
469,
2771,
1330,
28373,
11,
11086,
13... | 3.431373 | 51 |
'''
给定一个按照升序排列的整数数组 nums,和一个目标值 target。找出给定目标值在数组中的开始位置和结束位置。
如果数组中不存在目标值 target,返回 [-1, -1]。
'''
from typing import List
'''
解题思路:二分查找后向前后搜索
'''
s = Solution()
print(s.searchRange([5, 7, 7, 8, 8, 10], 8))
print(s.searchRange([5, 7, 7, 8, 8, 10], 6))
print(s.searchRange([], 0))
| [
7061,
6,
198,
198,
163,
119,
247,
22522,
248,
31660,
10310,
103,
162,
234,
231,
163,
227,
100,
39355,
229,
41753,
237,
162,
236,
240,
26344,
245,
21410,
46763,
112,
46763,
108,
46763,
108,
163,
119,
226,
997,
82,
171,
120,
234,
161,... | 1.091954 | 261 |
# --------------------------------------------------------
# THOR
# Licensed under The MIT License
# Written by Axel Sauer (axel.sauer@tum.de)
# --------------------------------------------------------
import abc
from types import SimpleNamespace
import numpy as np
import torch
import torch.nn.functional as F
import ... | [
2,
20368,
22369,
198,
2,
2320,
1581,
198,
2,
49962,
739,
383,
17168,
13789,
198,
2,
22503,
416,
42575,
311,
16261,
357,
897,
417,
13,
82,
16261,
31,
83,
388,
13,
2934,
8,
198,
2,
20368,
22369,
198,
198,
11748,
450,
66,
198,
6738,
... | 3.816667 | 120 |
import pytest
from django_ontruck.monads import Ok, Error, Result
@pytest.mark.parametrize('result, expected', [
(Ok("this is a valid result"), True),
(Error("this is an error"), False)
])
@pytest.mark.parametrize('result, expected', [
(Ok("this is a valid result"), True),
(Error("this is an erro... | [
11748,
12972,
9288,
198,
6738,
42625,
14208,
62,
756,
30915,
13,
2144,
5643,
1330,
6762,
11,
13047,
11,
25414,
628,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
10786,
20274,
11,
2938,
3256,
685,
198,
220,
220,
... | 2.377339 | 962 |
filename = "NtPump.txt"
print("Enter the ID of interest: (hex format)")
ID_enter = input()
parsed = []
whitelist = [ID_enter]
with open(filename) as f_obj:
lines = f_obj.readlines()
for line in lines:
for ID in whitelist:
if ID in line:
parsed.append(line)
with open("log_parse... | [
34345,
796,
366,
45,
83,
47,
931,
13,
14116,
1,
201,
198,
4798,
7203,
17469,
262,
4522,
286,
1393,
25,
357,
33095,
5794,
8,
4943,
201,
198,
2389,
62,
9255,
796,
5128,
3419,
201,
198,
79,
945,
276,
796,
17635,
201,
198,
1929,
270,
... | 2.175439 | 171 |
import pytest
from django.contrib.admin.templatetags.admin_urls import admin_urlname
from django.urls import reverse
from rest_framework import status
from datahub.company.models import Company, CompanyPermission
from datahub.company.test.factories import (
ArchivedCompanyFactory,
CompanyFactory,
Duplicate... | [
11748,
12972,
9288,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
28482,
13,
11498,
489,
265,
316,
3775,
13,
28482,
62,
6371,
82,
1330,
13169,
62,
6371,
3672,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
1334,
62,
30604... | 2.338983 | 2,832 |
# -*- coding: iso-8859-1 -*-
from app import db
# ejemplos de querys que puedo realizar
# http://packages.python.org/Flask-SQLAlchemy/index.html
| [
2,
532,
9,
12,
19617,
25,
47279,
12,
3459,
3270,
12,
16,
532,
9,
12,
201,
198,
6738,
598,
1330,
20613,
201,
198,
201,
198,
201,
198,
2,
304,
73,
18856,
418,
390,
42517,
893,
8358,
279,
1739,
78,
1103,
528,
283,
220,
220,
220,
... | 1.977778 | 90 |
#!/usr/bin/env python
#
# Author: Kirill Makhonin (@kirillmakhonin)
# Copyright (c) 2008-2016 California Institute of Technology.
# Copyright (c) 2016-2019 The Uncertainty Quantification Foundation.
# License: 3-clause BSD. The full license text is available at:
# - https://github.com/uqfoundation/dill/blob/master/LI... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
6434,
25,
7385,
359,
337,
11322,
261,
259,
4275,
74,
343,
359,
76,
11322,
261,
259,
8,
198,
2,
15069,
357,
66,
8,
3648,
12,
5304,
3442,
5136,
286,
8987,
13,
198,
2,
... | 2.972973 | 148 |
import unittest
import cryptocmp.api.historical.price.days
| [
11748,
555,
715,
395,
198,
198,
11748,
15149,
3149,
13,
15042,
13,
10034,
12409,
13,
20888,
13,
12545,
628
] | 3.210526 | 19 |
import logging
LOG_LEVELS = {
"info": logging.INFO,
"debug": logging.DEBUG,
"warning": logging.WARNING,
"error": logging.ERROR,
}
| [
11748,
18931,
198,
198,
25294,
62,
2538,
18697,
50,
796,
1391,
198,
220,
220,
220,
366,
10951,
1298,
18931,
13,
10778,
11,
198,
220,
220,
220,
366,
24442,
1298,
18931,
13,
30531,
11,
198,
220,
220,
220,
366,
43917,
1298,
18931,
13,
... | 2.534483 | 58 |
# -*- encoding: utf-8 -*-
# library for Mandrake | by vp1147
import shared as s
import utils as u
| [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
5888,
329,
13314,
33788,
930,
416,
410,
79,
1157,
2857,
198,
198,
11748,
4888,
355,
264,
198,
11748,
3384,
4487,
355,
334,
198
] | 2.605263 | 38 |
# ------------------------------------------------------------------------------
# @brief:
# The optimization agent is responsible for doing the updates.
# @author:
# modified from the code of kvfran, modified by Tingwu Wang
# -----------------------------------------------------------------------------... | [
2,
16529,
26171,
198,
2,
220,
220,
2488,
65,
3796,
25,
198,
2,
220,
220,
220,
220,
220,
220,
383,
23989,
5797,
318,
4497,
329,
1804,
262,
5992,
13,
198,
2,
220,
220,
2488,
9800,
25,
198,
2,
220,
220,
220,
220,
220,
220,
9518,
... | 1.868347 | 17,850 |
import time
import os
import logging
import platform
from datetime import datetime
import csv
import statistics
from polyglotdb import CorpusContext
from polyglotdb.config import CorpusConfig
from polyglotdb.io import (inspect_buckeye, inspect_textgrid, inspect_timit,
inspect_labbcat, inspect_... | [
11748,
640,
198,
11748,
28686,
198,
11748,
18931,
198,
11748,
3859,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
269,
21370,
198,
11748,
7869,
198,
198,
6738,
7514,
4743,
313,
9945,
1330,
44874,
21947,
198,
6738,
7514,
4743,
313,
... | 2.61762 | 1,101 |
from django import template
register = template.Library()
@register.simple_tag
@register.filter(is_safe=True)
| [
6738,
42625,
14208,
1330,
11055,
198,
198,
30238,
796,
11055,
13,
23377,
3419,
628,
198,
31,
30238,
13,
36439,
62,
12985,
628,
198,
31,
30238,
13,
24455,
7,
271,
62,
21230,
28,
17821,
8,
198
] | 3.285714 | 35 |
name = "BRATS Normalize" | [
3672,
796,
366,
11473,
33586,
14435,
1096,
1
] | 3 | 8 |
import collections
import os
import pprint
import re
from dataclasses import field, MISSING
from datetime import timedelta
from timeit import default_timer as timer
from typing import (
Any, Callable, cast, Dict, List, Optional, Tuple, Type, Union
)
import gql
import graphql
from taegis_sdk_python.errors import S... | [
11748,
17268,
198,
11748,
28686,
198,
11748,
279,
4798,
198,
11748,
302,
198,
6738,
4818,
330,
28958,
1330,
2214,
11,
49684,
2751,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
6738,
640,
270,
1330,
4277,
62,
45016,
355,
19781,
198,
6... | 3.42953 | 149 |
import torch.nn as nn
import torch.nn.functional as F
from models.encoders import ResNet
from models.decoders import DeepLabV3Decoder
from models.utils.init import initialize_weights
| [
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
6738,
4981,
13,
12685,
375,
364,
1330,
1874,
7934,
198,
6738,
4981,
13,
12501,
375,
364,
1330,
10766,
17822,
53,
18,
10707,
12342,
198... | 3.436364 | 55 |
#!/usr/bin/env python3
from perylune.GpsDop import *
gps = GpsDop()
# Wczytaj dane 10 satelitow z pliku
gps.load("data/gps-lab2-ecef-coords.txt")
# Zainicjalizuj wspolrzedne obserwatora (w ukladzie ECEF i LLA)
obs_ecef = gps.getObserverECEF()
obs_lla = gps.getObserverLLA()
# Wygeneruj wszystkie 4 elementowe kombi... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
583,
2645,
1726,
13,
38,
862,
35,
404,
1330,
1635,
198,
198,
70,
862,
796,
402,
862,
35,
404,
3419,
198,
198,
2,
370,
66,
7357,
83,
1228,
288,
1531,
838,
264,
378,... | 1.947791 | 498 |
import os
from pathlib import Path
from appdirs import user_data_dir
class EnvManager:
"""Stashes environment variables in a file and
retrieves them in (a different process) with get_environ
with failover to os.environ
"""
app_env_dir = Path(user_data_dir("NEBULO"))
app_env = app_env_dir / ... | [
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
598,
15908,
82,
1330,
2836,
62,
7890,
62,
15908,
628,
198,
4871,
2039,
85,
13511,
25,
198,
220,
220,
220,
37227,
1273,
7465,
2858,
9633,
287,
257,
2393,
290,
198,
220,
... | 2.804878 | 123 |
if __name__ == '__main__':
from tabulate import tabulate
from collections import deque
print('\n The first case👇 \n')
Bisection_Method('(5 * x ** 3) - (5 * x ** 2) + 6 * x - 2', 0, 1, 10/100)
print('\n The second case👇 \n')
Bisection_Method('(5 * x ** 3) - (5 * x ** 2) + 6 * x ... | [
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
422,
7400,
5039,
1330,
7400,
5039,
201,
198,
220,
220,
220,
422,
17268,
1330,
390,
4188,
201,
198,
201,
198,
220,
220,
220,
3601,
10786,
59... | 2.171975 | 157 |
import RPi.GPIO as GPIO
import time
import sys
GPIO.setmode(GPIO.BOARD)
pinlist = [int(sys.argv[1])]
for i in pinlist:
GPIO.setwarnings(False)
GPIO.setup(i, GPIO.OUT)
GPIO.cleanup(i)
| [
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
11748,
640,
198,
11748,
25064,
198,
198,
16960,
9399,
13,
2617,
14171,
7,
16960,
9399,
13,
8202,
9795,
8,
198,
198,
11635,
4868,
796,
685,
600,
7,
17597,
13,
853,
85,
58,
16,
12962... | 2.172414 | 87 |
#! coding=utf-8
from django.db import models
from django.contrib.auth.models import User
from django import forms
from django.template.defaultfilters import slugify
from django.core.urlresolvers import reverse
STATUS_CHOICES = (
('d', u"草稿"),
('p', u"发布"),
)
class Category(models.Model):
'''
大分类
... | [
2,
0,
19617,
28,
40477,
12,
23,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
28243,
13,
122... | 2.225941 | 239 |
from pprint import pprint
from pathlib import Path
import shutil
import json
if __name__ == "__main__":
pp = PermissionParser()
pass
| [
6738,
279,
4798,
1330,
279,
4798,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
4423,
346,
198,
11748,
33918,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
9788,
796,
2448,
3411,
46677,
3419,
... | 3.042553 | 47 |
class MetricsAliases:
"""Metrics key aliases.
A class to provide human-readable labels for each key in a
``metrics_dict`` that we might want use when coloring a classification
curve plot.
"""
cbar_dict = {
"tp": "True Positive (TP) Count",
"fp": "False Positive (FP) Count",
... | [
4871,
3395,
10466,
37893,
1386,
25,
198,
220,
220,
220,
37227,
9171,
10466,
1994,
47217,
13,
628,
220,
220,
220,
317,
1398,
284,
2148,
1692,
12,
46155,
14722,
329,
1123,
1994,
287,
257,
198,
220,
220,
220,
7559,
4164,
10466,
62,
11600... | 2.287411 | 421 |
import unittest
from unittest.mock import MagicMock
from unittest.mock import patch
| [
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
628
] | 3.148148 | 27 |
from __future__ import absolute_import
from __future__ import print_function
import math
import random
import os, sys
from pprint import pprint
from six.moves import map
from six.moves import range
from six.moves import zip
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from dpark impo... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
10688,
198,
11748,
4738,
198,
11748,
28686,
11,
25064,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
6738,
2237,
13,
76,
5241,... | 2.535211 | 710 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#-------------------------------------------------------------------------------
"""
**Name**
pyzombied — Start pyzombie server.
**Synopsis**
``pyzombied.py [options]``
**Description**
The ``pyzombied.py`` command shall start the *pyzombie* HTTP RESTful
se... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
2,
10097,
24305,
198,
37811,
198,
1174,
5376,
1174,
198,
220,
220,
220,
12972,
89,
2381,
798,
851,
7253,
12972,
89,
9081,
... | 2.608617 | 2,205 |
from flask import Flask
from flask_restful import Api
from flask_sqlalchemy import SQLAlchemy
from flask_jwt_extended import JWTManager
from flask_migrate import Migrate
app = Flask(__name__)
app.config.from_object('config.Config')
api = Api(app)
db = SQLAlchemy(app)
migrate = Migrate(app,db)
jwt = JWTManager(app... | [
6738,
42903,
1330,
46947,
198,
6738,
42903,
62,
2118,
913,
1330,
5949,
72,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
42903,
62,
73,
46569,
62,
2302,
1631,
1330,
449,
39386,
13511,
198,
6738,
42903,
62... | 2.97561 | 123 |
x, y = map(int, input().split())
week = ['MON','TUE','WED','THU','FRI','SAT','SUN']
month = [31,28,31,30,31,30,31,31,30,31,30,31]
print(week[(sum(month[i] for i in range(x-1))+y)%7-1])
| [
87,
11,
331,
796,
3975,
7,
600,
11,
5128,
22446,
35312,
28955,
198,
10464,
796,
37250,
27857,
41707,
51,
8924,
41707,
54,
1961,
41707,
4221,
52,
41707,
37,
7112,
41707,
50,
1404,
41707,
50,
4944,
20520,
198,
8424,
796,
685,
3132,
11,
... | 1.968085 | 94 |
from typing import Dict
from usim import Scope, interval, Resources, time
from lapis.drone import Drone
from lapis.monitor import sampling_required
class CondorJobScheduler(object):
"""
Goal of the htcondor job scheduler is to have a scheduler that somehow
mimics how htcondor does schedule jobs.
Htc... | [
6738,
19720,
1330,
360,
713,
198,
6738,
514,
320,
1330,
41063,
11,
16654,
11,
13864,
11,
640,
198,
198,
6738,
14779,
271,
13,
7109,
505,
1330,
38959,
198,
6738,
14779,
271,
13,
41143,
1330,
19232,
62,
35827,
628,
198,
198,
4871,
9724,... | 3.587121 | 264 |
#
# Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
#
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import object
import copy
from six.moves import configparser
| [
2,
198,
2,
15069,
357,
66,
8,
1853,
7653,
9346,
27862,
11,
3457,
13,
1439,
2489,
10395,
13,
198,
2,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
2003,
1330,
3210,
62,
32016,
198,
20307,
62,
32016,
13,
17350,
... | 3.848485 | 66 |
__author__ = "Andrea Tramacere"
import numpy as np
from .utils import *
__all__=['convert_nu_to_blob','convert_nu_to_src','convert_nuFnu_to_nuLnu_src']
def convert_nu_to_blob(nu,in_frame,delta,z):
"""converts Energies/frequencies from in_frame to blob rest frame
Args:
delta: beaming facto... | [
198,
834,
9800,
834,
796,
366,
1870,
21468,
833,
321,
558,
260,
1,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
764,
26791,
1330,
1635,
198,
198,
834,
439,
834,
28,
17816,
1102,
1851,
62,
28803,
62,
1462,
62,
2436,
672,
41707... | 2.033094 | 695 |
"""
Copyright (c) 2020-2021 by
José Diogo Lisboa Dutra <jdiogo@ufs.br>
Thiago Dias Bispo <thiagodiasbispo@gmail.com>
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 restrictio... | [
37811,
201,
198,
15269,
357,
66,
8,
12131,
12,
1238,
2481,
416,
220,
201,
198,
220,
220,
36997,
6031,
24076,
28546,
48614,
360,
35076,
1279,
73,
10989,
24076,
31,
3046,
82,
13,
1671,
29,
201,
198,
220,
220,
536,
29601,
360,
4448,
38... | 3.007797 | 1,539 |
import numpy as np
x1 = 1
third = 1 / 3
f = 4 / np.pi # Ettore Majorana's ring of a disk potential factor.
f2 = f * f
# Iterate to most stable root.
for i in range(2000):
x1 = np.power((192 * x1 * x1 + 2 * x1 * f - f2) / 192, third)
a = 1/(x1 - 1) # Negative charge.
print('Xi = 4/Pi, a = %.48f' %... | [
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
87,
16,
796,
352,
201,
198,
17089,
796,
352,
1220,
513,
201,
198,
69,
796,
604,
1220,
45941,
13,
14415,
1303,
412,
926,
382,
8386,
2271,
338,
5858,
286,
257,
11898,
2785,
... | 2.148276 | 580 |
#!/usr/bin/python
import unittest, sys, os
try:
from StringIO import StringIO
except:
from io import StringIO
# Import path to test the CLI
#try: from unittest.mock import patch
#except: from mock import patch
# buffer for capturing log info
logStream = StringIO()
# Need to start logger BEFORE importing any pyPlateC... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
555,
715,
395,
11,
25064,
11,
28686,
198,
28311,
25,
198,
197,
6738,
10903,
9399,
1330,
10903,
9399,
198,
16341,
25,
198,
197,
6738,
33245,
1330,
10903,
9399,
198,
2,
17267,
3108,... | 2.862832 | 226 |
import requests
| [
11748,
7007,
628
] | 5.666667 | 3 |
import asyncio
from queue import Queue
from sanic.response import json, text, HTTPResponse
from spf import SanicPlugin, SanicPluginsFramework
from unittest.mock import MagicMock
calledq = Queue()
def test_register_system_signals(spf):
"""Test if sanic register system signals"""
app = spf._app
plugin =... | [
11748,
30351,
952,
198,
6738,
16834,
1330,
4670,
518,
198,
6738,
5336,
291,
13,
26209,
1330,
33918,
11,
2420,
11,
7154,
51,
4805,
9774,
2591,
198,
6738,
599,
69,
1330,
2986,
291,
37233,
11,
2986,
291,
23257,
1040,
21055,
6433,
198,
67... | 2.680203 | 394 |
# -*- coding:utf-8 -*-
# Copyright (c) 2012 TiN
# Copyright (c) 2012, 2014 Tycho Andersen
# Copyright (c) 2013 Tao Sauvage
# Copyright (c) 2014-2015 Sean Vig
# Copyright (c) 2014 Adi Sieker
# Copyright (c) 2014 Foster McLane
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this soft... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
2321,
16953,
45,
198,
2,
15069,
357,
66,
8,
2321,
11,
1946,
7039,
6679,
42356,
198,
2,
15069,
357,
66,
8,
2211,
32120,
23167,
85,
496,
198,
2,
1... | 2.804059 | 1,281 |
from typing import BinaryIO, Generator, List, Optional, Tuple, Union
from xml.dom import minidom # type: ignore
from botto.core.models.kanjidic2 import Kanji, KanjiMeaningsReadings
| [
6738,
19720,
1330,
45755,
9399,
11,
35986,
11,
7343,
11,
32233,
11,
309,
29291,
11,
4479,
198,
6738,
35555,
13,
3438,
1330,
949,
312,
296,
220,
1303,
2099,
25,
8856,
198,
198,
6738,
3005,
78,
13,
7295,
13,
27530,
13,
27541,
73,
312,... | 3.169492 | 59 |
# -*- coding: utf-8 -*-
"""
@summary: Maya cooperative python library
@run: import coop.coopLib as lib (suggested)
@license: MIT
@repository: https://github.com/artineering-io/maya-coop
"""
from __future__ import print_function
from __future__ import unicode_literals
import os, sys, subprocess,... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
49736,
25,
220,
220,
220,
220,
220,
220,
26041,
22849,
21015,
5888,
198,
31,
5143,
25,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1330,
763,
4... | 2.34745 | 19,669 |
import sqlite3
from typing import Any, Iterable, List, Optional, Tuple
# Local
import settings as s
# Sqlite3 does not currently support path objects
database = str(s.DATABASE_LOCATION)
def basic_sql_query(sql: str, data: Iterable) -> None:
"""
Basic SQL query that connects, commits and closes off
the c... | [
11748,
44161,
578,
18,
198,
6738,
19720,
1330,
4377,
11,
40806,
540,
11,
7343,
11,
32233,
11,
309,
29291,
198,
198,
2,
10714,
198,
11748,
6460,
355,
264,
198,
198,
2,
311,
13976,
578,
18,
857,
407,
3058,
1104,
3108,
5563,
198,
48806... | 2.652997 | 951 |
"""A Todo-app implementation using pyramid_openapi3.
See README.md at
https://github.com/Pylons/pyramid_openapi3/tree/master/examples/todoapp
"""
from dataclasses import dataclass
from openapi_core.schema.exceptions import OpenAPIError
from openapi_core.schema.exceptions import OpenAPIMappingError
from pyramid.config... | [
37811,
32,
309,
24313,
12,
1324,
7822,
1262,
27944,
62,
9654,
15042,
18,
13,
198,
198,
6214,
20832,
11682,
13,
9132,
379,
198,
5450,
1378,
12567,
13,
785,
14,
47,
2645,
684,
14,
9078,
20255,
62,
9654,
15042,
18,
14,
21048,
14,
9866,... | 2.787108 | 1,179 |
import pandas as pd
import sys
args = sys.argv
if len(args) < 3:
print("Usage: python",args[0],"<infile.csv> <outfile.parquet> <OPTIONAL: compression type>")
quit(-1)
infile = args[1]
outfile = args[2]
compression_type = 'gzip'
if len(args) > 3:
compression_type = args[3]
df = pd.read_csv(infile)
df.to_pa... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
25064,
198,
22046,
796,
25064,
13,
853,
85,
198,
361,
18896,
7,
22046,
8,
1279,
513,
25,
198,
220,
220,
220,
3601,
7203,
28350,
25,
21015,
1600,
22046,
58,
15,
17241,
27,
259,
7753,
13,
... | 2.433333 | 150 |
from z3 import *
import networkx as nx
from .support_functions import json_parser
# previous_solutions = []
# PCF = unknown
# while PCF != unsat:
# PCF,solution = changer(problem,previous_solutions)
# previous_solutions.append(solution)
# print('#####################')
| [
6738,
1976,
18,
1330,
1635,
201,
198,
11748,
3127,
87,
355,
299,
87,
201,
198,
6738,
764,
11284,
62,
12543,
2733,
1330,
33918,
62,
48610,
201,
198,
201,
198,
2,
2180,
62,
82,
14191,
796,
17635,
201,
198,
2,
4217,
37,
796,
6439,
20... | 2.688073 | 109 |
"""
This runCybercaptain module contains the CyberCaptain class.
"""
import argparse
import fnmatch
import importlib
import os
import re
import sys
import time
import logging
import glob
from configobj import ConfigObj, ConfigObjError
from cybercaptain import *
from cybercaptain.utils.helpers import fileExists, is_... | [
37811,
220,
198,
1212,
1057,
20418,
527,
27144,
391,
8265,
4909,
262,
15101,
27898,
1398,
13,
198,
37811,
220,
198,
11748,
1822,
29572,
198,
11748,
24714,
15699,
198,
11748,
1330,
8019,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
2506... | 3.085302 | 11,219 |
from database import get_cursor
from mlmodel import get_knn_model_accuracy
import pandas as pd
connection, cursor = get_cursor()
id_cache = {} | [
6738,
6831,
1330,
651,
62,
66,
21471,
198,
6738,
25962,
19849,
1330,
651,
62,
15418,
77,
62,
19849,
62,
4134,
23843,
198,
11748,
19798,
292,
355,
279,
67,
628,
198,
38659,
11,
23493,
796,
651,
62,
66,
21471,
3419,
198,
312,
62,
2387... | 3.2 | 45 |
# Generated by Django 4.0.3 on 2022-03-18 11:57
import random
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
604,
13,
15,
13,
18,
319,
33160,
12,
3070,
12,
1507,
1367,
25,
3553,
198,
11748,
4738,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.939394 | 33 |
"""
Best time complexity: O(n)
Worst time complexity: O(n^2)
Best space complexity: O(1)
Worst space complexity: O(1)
"""
test_list_1 = [9, 5, 1, 3, 6, -2, -8]
test_list_2 = [9, 5, 1, 3, 6, -2, -8]
print("bubble_sort_1():", test_list_1, "=>", bubble_sort_1(test_list_2))
test_list_1 = [9, 5, 1, 3, 6, -2, -8]
test_list_... | [
37811,
198,
13014,
640,
13357,
25,
440,
7,
77,
8,
198,
54,
29422,
640,
13357,
25,
440,
7,
77,
61,
17,
8,
198,
13014,
2272,
13357,
25,
440,
7,
16,
8,
198,
54,
29422,
2272,
13357,
25,
440,
7,
16,
8,
198,
37811,
198,
198,
9288,
... | 1.884337 | 415 |
from django.db import models
from django.core import validators
DISCIPLINE_CHOICES = [
("ENG", "Track One Engineering"),
("CHE", "Chemical Engineering"),
("CIV", "Civil Engineering"),
("ELE", "Electrical Engineering"),
("CPE", "Computer Engineering"),
("ESC", "Engineering Science"),
("IND"... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
7295,
1330,
4938,
2024,
628,
198,
26288,
34,
4061,
24027,
62,
44899,
34444,
796,
685,
198,
220,
220,
220,
5855,
26808,
1600,
366,
24802,
1881,
14044,
12340,
198,
220... | 2.747706 | 218 |
#!/usr/bin/env python
"""
* Copyright (C) 2020, Mohamed Abdelkader.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright notice,
* this list of c... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
1635,
15069,
357,
34,
8,
12131,
11,
27469,
38758,
74,
5067,
13,
198,
1635,
198,
1635,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
163... | 3.277147 | 617 |
import json
import argparse
import tensorflow as tf
from tqdm import tqdm
from model.visil import ViSiL
from datasets import VideoGenerator
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-q', '--query_file', type=str, required=True,
help='Path to fil... | [
11748,
33918,
198,
11748,
1822,
29572,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
2746,
13,
4703,
346,
1330,
16049,
42801,
43,
198,
6738,
40522,
1330,
7623,
8645,
1352,
19... | 2.318182 | 1,826 |
"""Dev utils to be shared across 0x projects and packages."""
| [
37811,
13603,
3384,
4487,
284,
307,
4888,
1973,
657,
87,
4493,
290,
10392,
526,
15931,
198
] | 3.875 | 16 |
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.http import JsonResponse
from django.shortcuts import get_object_or_404, redirect
from django.template.loader import render_to_string
from django.views.decorators.http import require_POST
from django.urls import NoRe... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
11299,
19199,
13,
27530,
1330,
14041,
6030,
198,
6738,
42625,
14208,
13,
4023,
1330,
449,
1559,
31077,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,... | 3.491979 | 187 |
from datetime import timedelta
from django.urls import reverse
from django.utils import timezone
from jcasts.shared.template import (
absolute_uri,
active_link,
approx_timesince,
colorpicker,
format_duration,
login_url,
markup,
normalize_url,
pagination_url,
re_active_link,
... | [
6738,
4818,
8079,
1330,
28805,
12514,
198,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
198,
6738,
474,
40924,
13,
28710,
13,
28243,
1330,
357,
198,
220,
220,
220,
4112,
... | 2.46798 | 203 |
import pyautogui as pag
pag.moveTo(459,220,0)
pag.scroll(0,10)
| [
11748,
12972,
2306,
519,
9019,
355,
42208,
220,
198,
198,
79,
363,
13,
21084,
2514,
7,
33459,
11,
17572,
11,
15,
8,
198,
79,
363,
13,
48728,
7,
15,
11,
940,
8,
198
] | 1.969697 | 33 |
import struct
| [
11748,
2878,
198
] | 4.666667 | 3 |
import json
import os
import time
from bzt.utils import is_windows
from tests import RESOURCES_DIR
from tests.modules.selenium import SeleniumTestCase
| [
11748,
33918,
198,
11748,
28686,
198,
11748,
640,
198,
198,
6738,
275,
89,
83,
13,
26791,
1330,
318,
62,
28457,
198,
6738,
5254,
1330,
15731,
2606,
7397,
1546,
62,
34720,
198,
6738,
5254,
13,
18170,
13,
741,
47477,
1330,
15300,
47477,
... | 3.477273 | 44 |
from abc import ABC, abstractmethod
from typing import List, Optional, Sequence, Tuple
import ssz
from eth_typing import BlockNumber
from eth.abc import AtomicDatabaseAPI, DatabaseAPI
from eth2.beacon.types.deposit_data import DepositData
from .exceptions import DepositDataDBValidationError
| [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
198,
6738,
19720,
1330,
7343,
11,
32233,
11,
45835,
11,
309,
29291,
198,
198,
11748,
37786,
89,
198,
198,
6738,
4555,
62,
774,
13886,
1330,
9726,
15057,
198,
198,
6738,
4555,
13,
39305... | 3.630952 | 84 |
import argparse
import datetime
import time
import logging
import re
import apache_beam as beam
import apache_beam.io.gcp.bigquery_tools as bqt
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.options.pipeline_options import SetupOptions
from apache_beam.options.pipeline_options import... | [
11748,
1822,
29572,
198,
11748,
4818,
8079,
198,
11748,
640,
198,
11748,
18931,
198,
11748,
302,
198,
198,
11748,
2471,
4891,
62,
40045,
355,
15584,
198,
11748,
2471,
4891,
62,
40045,
13,
952,
13,
70,
13155,
13,
14261,
22766,
62,
31391,... | 3.11465 | 157 |
weights = [70,80,45,50]
print(weights)
maximum = max(weights)
print(maximum)
weights [2] = 48
print(weights)
total = sum(weights)
print(total)
mean = total/4
print(mean) | [
43775,
796,
685,
2154,
11,
1795,
11,
2231,
11,
1120,
60,
201,
198,
4798,
7,
43775,
8,
201,
198,
201,
198,
47033,
796,
3509,
7,
43775,
8,
201,
198,
4798,
7,
47033,
8,
201,
198,
201,
198,
43775,
685,
17,
60,
796,
4764,
201,
198,
... | 2.325 | 80 |
import os,io
import pandas as pd
from shlex import quote
from contextlib import redirect_stdout
from igf_data.utils.fileutils import get_temp_dir,remove_dir,check_file_path,copy_local_file
def run_plotCoverage(bam_files,output_raw_counts,plotcov_stdout,output_plot=None,
blacklist_file=None,thre... | [
11748,
28686,
11,
952,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
427,
2588,
1330,
9577,
198,
6738,
4732,
8019,
1330,
18941,
62,
19282,
448,
628,
198,
198,
6738,
45329,
69,
62,
7890,
13,
26791,
13,
7753,
26791,
1330,
651,
62,
... | 2.13964 | 4,662 |
#!/usr/bin/env python
# -*- coding=utf-8 -*-
from .MLargs import args
from .MLpipe import Pipe
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
28,
40477,
12,
23,
532,
9,
12,
198,
6738,
764,
5805,
22046,
1330,
26498,
198,
6738,
764,
5805,
34360,
1330,
36039,
628
] | 2.666667 | 36 |
from django.db import models
from django_quill.fields import QuillField
from django.contrib.auth.models import User
from apps.subject.models import Subject | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
62,
421,
359,
13,
25747,
1330,
2264,
359,
15878,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
6725,
13,
32796,
13,
27530,
1330,
... | 3.690476 | 42 |
'''
Calculates and plots a latent heat release proxy for OpenMARS, Isca - all years
and climatology.
'''
import numpy as np
import xarray as xr
import os, sys
import analysis_functions as funcs
import colorcet as cc
import string
from cartopy import crs as ccrs
import matplotlib.pyplot as plt
import m... | [
7061,
6,
201,
198,
9771,
3129,
689,
290,
21528,
257,
41270,
4894,
2650,
15741,
329,
4946,
44,
27415,
11,
1148,
6888,
532,
477,
812,
201,
198,
392,
5424,
265,
1435,
13,
201,
198,
7061,
6,
201,
198,
201,
198,
11748,
299,
32152,
355,
... | 1.736197 | 8,241 |
import os
import shutil
import subprocess
import tempfile
import unittest
import git
from ..layers import GitRestashFunctional
| [
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
850,
14681,
198,
11748,
20218,
7753,
198,
11748,
555,
715,
395,
198,
198,
11748,
17606,
198,
198,
6738,
11485,
75,
6962,
1330,
15151,
19452,
1077,
22203,
282,
628
] | 3.611111 | 36 |
import os
import numpy as np
from unittest import TestCase
from parflow.subset.tools import rasterize_shape
from parflow.subset.utils.io import read_file, read_bbox
import test_files
| [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
1582,
11125,
13,
7266,
2617,
13,
31391,
1330,
374,
1603,
1096,
62,
43358,
198,
6738,
1582,
11125,
13,
7266,
2617,
13,
26791,
13,
... | 3.189655 | 58 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'choice.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
5178,
7822,
7560,
422,
3555,
334,
72,
2393,
705,
25541,
13,
9019,
6,
198,
2,
198,
2,
15622,
416,
25,
9485,
48,
83,
20,
12454,
2438,
17301,
642,
13,
20,
13,... | 2.833333 | 84 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Reads a colloquial and a standard Finnish vocabulary, and for each (reduced)
# word form that exists only in the colloquial vocabulary (e.g. "sitkö"), finds
# its base form (e.g. "sittenkö").
import argparse
import sys
from copy import deepcopy
from filetypes import T... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
4149,
82,
257,
2927,
22696,
498,
290,
257,
3210,
26838,
25818,
11,
290,
329,
1123,
357,
445,
19513,
... | 2.600153 | 1,308 |
from protosc.model.utils import select_features
from protosc.model.utils import train_xvalidate
from protosc.model.base import BaseFoldModel
| [
6738,
1237,
17500,
13,
19849,
13,
26791,
1330,
2922,
62,
40890,
198,
6738,
1237,
17500,
13,
19849,
13,
26791,
1330,
4512,
62,
87,
12102,
378,
198,
6738,
1237,
17500,
13,
19849,
13,
8692,
1330,
7308,
37,
727,
17633,
628,
198
] | 3.575 | 40 |
"""The polling mixin for controllers (poller) helps controllers to update the view based on changes in the model"""
from julesTk.controller import Controller
__author__ = "Joeri Jongbloets <joeri@jongbloets.net>"
class Poller(Controller):
"""A controller that does something at a given interval"""
@property... | [
37811,
464,
13985,
5022,
259,
329,
20624,
357,
30393,
263,
8,
5419,
20624,
284,
4296,
262,
1570,
1912,
319,
2458,
287,
262,
2746,
37811,
198,
198,
6738,
474,
5028,
51,
74,
13,
36500,
1330,
22741,
198,
198,
834,
9800,
834,
796,
366,
... | 2.940789 | 152 |
#coding:utf-8
from .context import Context
from . import lasttest
| [
2,
66,
7656,
25,
40477,
12,
23,
198,
198,
6738,
764,
22866,
1330,
30532,
198,
6738,
764,
1330,
938,
9288,
628
] | 3.238095 | 21 |
#!/usr/bin/env python
"""
This module provides AcquisitionEra.GetID data access object.
"""
from dbs.dao.Oracle.AcquisitionEra.GetID import GetID as OraAcquisitionEraGetID
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
1212,
8265,
3769,
44564,
36,
430,
13,
3855,
2389,
1366,
1895,
2134,
13,
198,
37811,
198,
6738,
288,
1443,
13,
67,
5488,
13,
48625,
13,
12832,
421,
10027,
36,
430,
13,
385... | 2.982759 | 58 |
import io
import unittest
from tempfile import mkstemp
from catatom2osm import csvtools
from catatom2osm.config import delimiter, encoding
from catatom2osm.exceptions import CatIOError
| [
171,
119,
123,
11748,
33245,
198,
11748,
555,
715,
395,
198,
6738,
20218,
7753,
1330,
33480,
927,
79,
198,
198,
6738,
3797,
37696,
17,
418,
76,
1330,
269,
21370,
31391,
198,
6738,
3797,
37696,
17,
418,
76,
13,
11250,
1330,
46728,
2676... | 3.186441 | 59 |
import praw
from pprint import pprint
from collections import defaultdict
from .matchresult import MatchResult
import re
from typing import Dict, Sequence, Tuple
from tabulate import tabulate
| [
11748,
279,
1831,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
764,
15699,
20274,
1330,
13225,
23004,
198,
11748,
302,
198,
6738,
19720,
1330,
360,
713,
11,
45835,
11,
309,
29291,
198,
6738,
740... | 4.173913 | 46 |
import numpy as np
import pandas as pd
import os
import pickle5 as pickle
import matplotlib.pyplot as plt
import pandas as pd
import tensorflow as tf
from tensorflow.keras.models import load_model
tf.keras.backend.set_floatx('float64')
from functions.tf_loss_custom import compute_loss_mae, eval_loss_raw
from function... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28686,
198,
11748,
2298,
293,
20,
355,
2298,
293,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
11748,
19798,
292,
355,
279,
67... | 2.282282 | 1,998 |
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: dcodea
#
# Created: 03/11/2019
# Copyright: (c) dcodea 2019
# Licence: <your licence>
#-------------------------------------------------------------------------------
if __name_... | [
2,
10097,
24305,
198,
2,
6530,
25,
220,
220,
220,
220,
220,
220,
220,
8265,
16,
198,
2,
32039,
25,
198,
2,
198,
2,
6434,
25,
220,
220,
220,
220,
220,
288,
8189,
64,
198,
2,
198,
2,
15622,
25,
220,
220,
220,
220,
7643,
14,
11... | 3.55102 | 98 |
from early_stopping_pytorch.early_stopping import EarlyStopping
__all__ = ["EarlyStopping"]
| [
6738,
1903,
62,
301,
33307,
62,
9078,
13165,
354,
13,
11458,
62,
301,
33307,
1330,
12556,
1273,
33307,
198,
198,
834,
439,
834,
796,
14631,
20457,
1273,
33307,
8973,
198
] | 3.1 | 30 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from numpy import *
from logger import logger
import csv
SALE_DATE = 'sale_date'
CLASS_ID = 'class_id'
SALE_QUANTITY = 'sale_quantity'
BRAND_ID = 'brand_id'
COMPARTMENT = 'compartment'
TYPE_ID = 'type_id'
LEVEL_ID = 'level_id'
DEPARTMENT_ID = 'department_id'
TR = 'TR'
GEARB... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
12,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
6738,
299,
32152,
1330,
1635,
198,
6738,
49706,
1330,
49706,
198,
11748,
269,
21370,
198,
198,
50,
21358,
62,
35,
6158... | 2.23389 | 838 |
from distutils.core import setup
setup(
name='Marilyn',
packages=['Marilyn'], # this must be the same as the name above
version='0.0.1',
description='Marilyn SDK',
author='user',
author_email='skar404@gmail.com',
url='https://github.com/peterldowns/mypackage', # use the URL to the github ... | [
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
44,
3093,
77,
3256,
198,
220,
220,
220,
10392,
28,
17816,
44,
3093,
77,
6,
4357,
220,
1303,
428,
1276,
307,
262,
976,
355,
262,
1438,
20... | 2.676606 | 436 |
from enum import Enum
| [
6738,
33829,
1330,
2039,
388,
628
] | 3.833333 | 6 |
# Code to compute louvain partitioning on a network
# Requires conversion of each file wise rasters; see split_npz_rasters.py file which takes wholetrack rasters and splits them
# Network edge weights defined by pair-wise correlation values
#
# TODO: -read more about Louvain partitioning;
# -there are other al... | [
2,
6127,
284,
24061,
21081,
85,
391,
18398,
278,
319,
257,
3127,
198,
2,
26848,
11315,
286,
1123,
2393,
10787,
374,
7060,
26,
766,
6626,
62,
37659,
89,
62,
81,
7060,
13,
9078,
2393,
543,
2753,
508,
1616,
39638,
374,
7060,
290,
30778... | 2.120427 | 3,936 |
from sum_eval import MultiProcSumEval
import argparse, os
if __name__ == '__main__':
args = get_args()
result_file = args.result
article_file = args.article
summary_file = args.summary
entity_map_file = args.entity_map
mp_sum_eval = MultiProcSumEval(5)
outfile = os.path.join(args.out_dir... | [
198,
6738,
2160,
62,
18206,
1330,
15237,
2964,
66,
13065,
36,
2100,
198,
11748,
1822,
29572,
11,
28686,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
26498,
796,
651,
62,
22046,
3419,
198,
220... | 2.482042 | 529 |
import dlvhex
from SPARQLWrapper import SPARQLWrapper, JSON
import configparser
| [
11748,
288,
6780,
33095,
198,
6738,
6226,
1503,
9711,
36918,
2848,
1330,
6226,
1503,
9711,
36918,
2848,
11,
19449,
198,
11748,
4566,
48610,
628,
628,
198
] | 3.230769 | 26 |
import json
import os
from tkinter import filedialog
from tkinter import messagebox
from tkinter import *
import boxnotes2html # https://pypi.org/project/boxnotes2html/
from typing import Dict
from htmldocx import HtmlToDocx # https://pypi.org/project/htmldocx/
def import_settings() -> Dict:
"""
Function th... | [
11748,
33918,
198,
11748,
28686,
198,
6738,
256,
74,
3849,
1330,
5717,
498,
519,
198,
6738,
256,
74,
3849,
1330,
3275,
3524,
198,
6738,
256,
74,
3849,
1330,
1635,
198,
11748,
3091,
17815,
17,
6494,
220,
1303,
3740,
1378,
79,
4464,
72,... | 2.60989 | 728 |