content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 18 00:16:46 2018
@author: maximoskaliakatsos-papakostas
"""
import numpy as np
import copy
import computeDIC as dic
import os
cwd = os.getcwd()
import sys
sys.path.insert(0, cwd + '/CM_auxiliary')
import CM_Misc_Aux_functions as maf
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
3825,
5267,
1248,
3571,
25,
1433,
25,
3510,
2864,
201,
198,
201,
198,
31,
... | 2.403226 | 186 |
#!/usr/bin/env python3
from __future__ import print_function
desc = '''Generate statistics about optimization records from the YAML files
generated with -fsave-optimization-record and -fdiagnostics-show-hotness.
The tools requires PyYAML and Pygments Python packages.'''
import optrecord
import argparse
import opera... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
20147,
796,
705,
7061,
8645,
378,
7869,
546,
23989,
4406,
422,
262,
575,
2390,
43,
3696,
198,
27568,
351,
532,
9501,
... | 2.366698 | 1,069 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import pandas as pd
import os
import sys
from sklearn import preprocessing
from collections import Iterable
import numpy as np
from util_functions import safe_mkdir
import pickle
from clonesig import mixin_init_parameters
from clonesig.estimator import Estimator, log_binomia... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
1341,
35720,
1330,
662,
36948,
198,
6738,
... | 2.064144 | 6,501 |
import math
import find_homography_distance
from tabulate import tabulate
import scipy.io
import os
import operator
import numpy as np
import ast
import pickle
import sys
results = {}
template = set()
test = set()
print("nada0")
##################
# MATRIX DO CONCORRENTE
###################
#test = ('adidas_test90... | [
11748,
10688,
198,
11748,
1064,
62,
26452,
4867,
62,
30246,
198,
6738,
7400,
5039,
1330,
7400,
5039,
198,
11748,
629,
541,
88,
13,
952,
198,
11748,
28686,
198,
11748,
10088,
220,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
6468,
198... | 2.554795 | 292 |
from .general import __quotes
from .url_methods import (
__return_json_v3,
__return_json_v4,
__validate_exchange,
)
import typing
def quote_short(apikey: str, symbol: str) -> typing.List[typing.Dict]:
"""
Query FMP /quote-short/ API.
:param apikey: Your API key
:param symbol: Company ti... | [
6738,
764,
24622,
1330,
11593,
421,
6421,
198,
198,
6738,
764,
6371,
62,
24396,
82,
1330,
357,
198,
220,
220,
220,
11593,
7783,
62,
17752,
62,
85,
18,
11,
198,
220,
220,
220,
11593,
7783,
62,
17752,
62,
85,
19,
11,
198,
220,
220,
... | 2.418736 | 886 |
#
# usage: python k68.py {tag}
#
import sys
import pymongo
if __name__ == '__main__':
t = sys.argv[1]
for a in top10(t):
print(a[0], a[1])
| [
2,
198,
2,
8748,
25,
21015,
479,
3104,
13,
9078,
1391,
12985,
92,
198,
2,
198,
198,
11748,
25064,
198,
11748,
279,
4948,
25162,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
256,
796,
25064,... | 1.9625 | 80 |
#
# 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
# distributed un... | [
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
257,
4866,
286,
262,
13789,
379,... | 1.783317 | 11,533 |
import unittest
import mock
from utest.helper import (write_json, read_json, remove_file)
from utils.confluence import *
| [
11748,
555,
715,
395,
198,
11748,
15290,
198,
6738,
3384,
395,
13,
2978,
525,
1330,
357,
13564,
62,
17752,
11,
1100,
62,
17752,
11,
4781,
62,
7753,
8,
198,
6738,
3384,
4487,
13,
10414,
23079,
1330,
1635,
198
] | 3.184211 | 38 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
import chardet
import jieba
letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
dight2hanzi = {'0':'零', '1': '一', '2':'二', '3':'三', '4':'四', '5':'五', '6':'六', '7':'七', '8':'八', ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
25064,
198,
11748,
302,
198,
11748,
442,
446,
316,
198,
11748,
474,
494,
7012,
198,
198,
15653,
796,
705,
... | 1.870861 | 302 |
abc=('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z')
print('='*30)
print('Primeiras 5 letras',abc[0:5])
print('='*30)
print('ultimas 4 letras',abc[-4:])
print('='*30)
print('abc em ordem alfabetica',(sorted(abc)))
print('='*30)
letra=str(input(f'Digite uma letra ... | [
39305,
28,
10786,
32,
41707,
33,
41707,
34,
41707,
35,
41707,
36,
41707,
37,
41707,
38,
41707,
39,
41707,
40,
41707,
41,
41707,
42,
41707,
43,
41707,
44,
41707,
45,
41707,
46,
41707,
47,
41707,
48,
41707,
49,
41707,
50,
41707,
51,
4... | 2.153846 | 208 |
from basicgeo import P3
import math
# this module handles balls touching triangles along a vector and closest approach of the triangles to a point
| [
6738,
4096,
469,
78,
1330,
350,
18,
198,
11748,
10688,
198,
198,
2,
428,
8265,
17105,
11333,
15241,
44360,
1863,
257,
15879,
290,
11706,
3164,
286,
262,
44360,
284,
257,
966,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 3.6 | 45 |
from unittest import TestCase
from mock import patch
from pyselenium.test_steps import *
from tests.test_data import *
from tests.testables import DriverTestable
class TestStepResult(TestCase):
""""Has unit tests for the StepResult class"""
class TestElementAttributeValueIncorrectError(TestCase):
"""Has u... | [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
15290,
1330,
8529,
198,
198,
6738,
12972,
741,
47477,
13,
9288,
62,
20214,
1330,
1635,
198,
6738,
5254,
13,
9288,
62,
7890,
1330,
1635,
198,
6738,
5254,
13,
9288,
2977,
1330,
124... | 3.566038 | 424 |
##
# \file correct_bias_field.py
# \brief Script to correct for bias field. Based on N4ITK
#
# \author Michael Ebner (michael.ebner.14@ucl.ac.uk)
# \date October 2017
#
# Import libraries
import numpy as np
import os
import niftymic.base.stack as st
import niftymic.base.data_writer as dw
import niftymi... | [
2235,
198,
2,
3467,
7753,
3376,
62,
65,
4448,
62,
3245,
13,
9078,
198,
2,
3467,
65,
3796,
220,
220,
220,
220,
220,
12327,
284,
3376,
329,
10690,
2214,
13,
13403,
319,
399,
19,
2043,
42,
198,
2,
198,
2,
3467,
9800,
220,
220,
220,... | 2.709091 | 220 |
# coding=utf-8
# Copyright 2018 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
2,
19617,
28,
40477,
12,
23,
198,
198,
2,
15069,
2864,
3012,
3457,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
... | 3.786697 | 436 |
import torch
from torch import nn
| [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
628
] | 3.888889 | 9 |
from toolz import curry
@curry
def zip_obj(key, val):
"""Creates a new object out of a list of keys and a list of values.
Key/value pairing is truncated to the length of the shorter of the two lists.
Note: zipObj is equivalent to pipe(zip, fromPairs)"""
return dict(zip(key, val))
| [
6738,
2891,
89,
1330,
34611,
628,
198,
31,
66,
16682,
198,
4299,
19974,
62,
26801,
7,
2539,
11,
1188,
2599,
198,
220,
220,
220,
37227,
16719,
274,
257,
649,
2134,
503,
286,
257,
1351,
286,
8251,
290,
257,
1351,
286,
3815,
13,
198,
... | 3.05102 | 98 |
from datetime import datetime
from django.contrib.gis.db import models
from django.db.models import F, Q, IntegerField, Func
from django.utils.timezone import now, timedelta
from tqdm import tqdm
import pytz
from data.models import Officer, Award
from data.constants import (
ALLEGATION_MAX_DATETIME, ALLEGATION_M... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
70,
271,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
376,
11,
1195,
11,
34142,
15878,
11,
11138,
66,
198,
6738,
42625,
... | 2.696918 | 584 |
import argparse
import warnings
warnings.filterwarnings("ignore")
from keras import backend as K
import numpy as np
from helper import Coverage
from helper import load_data
import tensorflow as tf
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
####for solving some specific problems, don't care
config = tf.compa... | [
11748,
1822,
29572,
198,
11748,
14601,
198,
198,
40539,
654,
13,
24455,
40539,
654,
7203,
46430,
4943,
198,
198,
6738,
41927,
292,
1330,
30203,
355,
509,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
31904,
1330,
33998,
198,
6738,
31904,... | 2.408254 | 1,357 |
#!/usr/bin/env python
import pdb_parser as parser
if __name__=="__main__":
from sys import argv
prot_pdb = argv[-1]
for l in correct_offset(parser.parse_file(prot_pdb)):
print(parser.pdb_format(l))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
279,
9945,
62,
48610,
355,
30751,
198,
198,
361,
11593,
3672,
834,
855,
1,
834,
12417,
834,
1298,
198,
220,
220,
220,
422,
25064,
1330,
1822,
85,
198,
220,
220,
220,
1237... | 2.291667 | 96 |
# -*- coding: utf-8 -*-
from ralph.accounts.api_simple import SimpleRalphUserSerializer
from ralph.api import RalphAPISerializer, RalphAPIViewSet, router
from ralph.assets.api.serializers import AssetSerializer
from ralph.assets.api.views import base_object_descendant_prefetch_related
from ralph.back_office.admin impor... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
374,
17307,
13,
23317,
82,
13,
15042,
62,
36439,
1330,
17427,
49,
17307,
12982,
32634,
7509,
198,
6738,
374,
17307,
13,
15042,
1330,
20993,
2969,
1797,
48499,
7509,
... | 3.164251 | 207 |
# -*- coding: utf-8 -*-
# author: ysoftman
# python version : 2.x 3.x
# desc : jinja test
# install : pip install jinja2
import os
from jinja2 import Template
from jinja2 import Environment, FileSystemLoader
if __name__ == '__main__':
jinja_test()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
1772,
25,
331,
4215,
805,
198,
2,
21015,
2196,
1058,
362,
13,
87,
513,
13,
87,
198,
2,
1715,
1058,
474,
259,
6592,
1332,
198,
2,
2721,
1058,
7347,
2721,
474,
25... | 2.639175 | 97 |
"""
Django settings for server project.
Generated by 'django-admin startproject' using Django 3.0.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# ... | [
37811,
198,
35,
73,
14208,
6460,
329,
4382,
1628,
13,
198,
198,
8645,
515,
416,
705,
28241,
14208,
12,
28482,
923,
16302,
6,
1262,
37770,
513,
13,
15,
13,
21,
13,
198,
198,
1890,
517,
1321,
319,
428,
2393,
11,
766,
198,
5450,
1378... | 2.258741 | 2,002 |
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
from waflib.Configure import conf
STD_TO_STRING = '''
#include <string>
int
main()
{
std::string s = std::to_string(0);
s = std::to_string(0l);
s = std::to_string(0ll);
s = std::to_string(0u);
s = std::to_string(0ul);
s = s... | [
2,
532,
9,
12,
10363,
25,
21015,
26,
12972,
12,
521,
298,
12,
28968,
25,
604,
26,
33793,
12,
8658,
82,
12,
14171,
25,
18038,
26,
19617,
25,
3384,
69,
12,
23,
26,
532,
9,
12,
198,
198,
6738,
266,
1878,
8019,
13,
16934,
495,
133... | 2.127796 | 313 |
import subprocess
if __name__ == '__main__':
test_command()
| [
11748,
850,
14681,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1332,
62,
21812,
3419,
198
] | 2.708333 | 24 |
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"collapsed": true,
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"# Enumerating Gene Orders\n",
"## Problem\n",
"A permutation of length n is an ordering of the positive integers {1,2,…,n}. For example, π=(5,3,2,1,4) is... | [
90,
198,
366,
46342,
1298,
685,
198,
220,
1391,
198,
220,
220,
366,
3846,
62,
4906,
1298,
366,
4102,
2902,
1600,
198,
220,
220,
366,
38993,
1298,
1391,
198,
220,
220,
220,
366,
26000,
28361,
1298,
2081,
11,
198,
220,
220,
220,
366,
... | 1.92937 | 1,699 |
# Copyright 2014 Open Source Robotics Foundation, 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... | [
2,
15069,
1946,
4946,
8090,
47061,
5693,
11,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 3.779412 | 204 |
from __future__ import annotations
from typing import TYPE_CHECKING, TypedDict, Tuple
if TYPE_CHECKING:
from .snowflake import Snowflake
__all__ = (
"Permissions",
"Role",
)
Permissions = Tuple[int, int]
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
41876,
62,
50084,
2751,
11,
17134,
276,
35,
713,
11,
309,
29291,
198,
198,
361,
41876,
62,
50084,
2751,
25,
198,
220,
220,
220,
422,
764,
82,
2197,
47597,
1330,
7967,
... | 2.753086 | 81 |
#!/usr/bin/env python
#
# Copyright 2011-2012 Andreas Wundsam
#
# 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 applic... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
2813,
12,
6999,
33728,
370,
917,
37687,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407... | 3.382716 | 243 |
from cmvc.models.layer import *
from cmvc.models.enc import *
from cmvc.models.dec import *
from cmvc.models.model import * | [
6738,
12067,
28435,
13,
27530,
13,
29289,
1330,
1635,
201,
198,
6738,
12067,
28435,
13,
27530,
13,
12685,
1330,
1635,
201,
198,
6738,
12067,
28435,
13,
27530,
13,
12501,
1330,
1635,
201,
198,
6738,
12067,
28435,
13,
27530,
13,
19849,
13... | 3 | 42 |
import unittest
import numpy as np
from odbm.utils import *
"""Unit test for utils functions"""
def test_extractParams:
param_str = 'k:100;k2:200'
param_dict = extractParams(param_str)
self.assertTrue(len(param_dict) == 2)
self.assertTrue(param_dict['k'] == '100')
bad_string = 'k:100,k2:200'
... | [
11748,
555,
715,
395,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
267,
9945,
76,
13,
26791,
1330,
1635,
628,
198,
37811,
26453,
1332,
329,
3384,
4487,
5499,
37811,
198,
4299,
1332,
62,
2302,
974,
10044,
4105,
25,
198,
220,
220,
220... | 2.529412 | 187 |
# -*- encoding: utf-8 -*-
"""
"""
from youpy.api import Sprite
from youpy.api import get_context_frontend_sprite
| [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
37811,
628,
198,
6738,
345,
9078,
13,
15042,
1330,
33132,
198,
6738,
345,
9078,
13,
15042,
1330,
651,
62,
22866,
62,
8534,
437,
62,
34975,
578,
628
] | 2.697674 | 43 |
# -*- coding: utf-8 -*-
'''
Source: https://github.com/cmyui/cmyui_pkg
:copyright: (c) 2021 cmyui
:license: MIT, see LICENSE for details.
'''
import ctypes
import functools
from types import TracebackType
from typing import Optional
from typing import Type
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
7416,
25,
3740,
1378,
12567,
13,
785,
14,
66,
1820,
9019,
14,
66,
1820,
9019,
62,
35339,
198,
198,
25,
22163,
4766,
25,
357,
66,
8,
33448,
269,
1820,
... | 1.959417 | 6,111 |
# -*- coding: utf-8 -*-
"""
:author: Dream Zhou (周梦雄)
:url: https://heypython.cn
:copyright: © 2020 Dream Zhou <zhoumengxiong@outlook.com>
:license: MIT, see LICENSE for more details.
"""
from flask import render_template
from . import app
@app.errorhandler(400)
@app.errorhandler(404)
@app.errorh... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
1058,
9800,
25,
7610,
32222,
357,
37772,
101,
162,
95,
99,
37239,
226,
8,
198,
220,
220,
220,
1058,
6371,
25,
3740,
1378,
258,
4464,
7535,
... | 2.477612 | 134 |
# -*- coding: utf-8 -*-
#############################################################################
#
# Copyright © Dragon Dollar Limited
# contact: contact@dragondollar.com
#
# This software is a collection of webservices designed to provide a secure
# and scalable framework to build e-commerce websites.
#
# This s... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
29113,
29113,
7804,
4242,
2,
198,
2,
198,
2,
15069,
10673,
2851,
29747,
15302,
198,
2,
2800,
25,
2800,
31,
7109,
363,
623,
13228,
13,
785,
198,
2,
198,
2,
770,
... | 4.359551 | 445 |
from django.db import models
from generic.models import BaseModel
from . import Brand, Category, Warehouse
from coreapi.models import Company
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
14276,
13,
27530,
1330,
7308,
17633,
198,
6738,
764,
1330,
13512,
11,
21743,
11,
45927,
198,
6738,
4755,
15042,
13,
27530,
1330,
5834,
628
] | 4.333333 | 33 |
from django.db import models
from django.contrib.postgres.fields import ArrayField
class ArticleTag(models.Model):
"""Model for single tag"""
tag_text = models.CharField(unique=True, max_length=50)
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
7353,
34239,
13,
25747,
1330,
15690,
15878,
198,
198,
4871,
10172,
24835,
7,
27530,
13,
17633,
2599,
198,
220,
220,
220,
37227,
17633,
329,
2060,
7621... | 3.136364 | 66 |
from baconian.core.core import Env, EnvSpec
have_mujoco_flag = True
try:
from dm_control import mujoco
from gym.envs.mujoco import mujoco_env
from dm_control import suite
from dm_control.rl.specs import ArraySpec
from dm_control.rl.specs import BoundedArraySpec
from collections import OrderedDi... | [
6738,
21385,
666,
13,
7295,
13,
7295,
1330,
2039,
85,
11,
2039,
85,
22882,
198,
198,
14150,
62,
76,
23577,
25634,
62,
32109,
796,
6407,
198,
28311,
25,
198,
220,
220,
220,
422,
288,
76,
62,
13716,
1330,
285,
23577,
25634,
198,
220,
... | 2.109177 | 2,528 |
#
# Copyright 2021 Lars Pastewka
# 2021 Johannes Laurin Hörmann
#
# ### MIT license
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitati... | [
2,
198,
2,
15069,
33448,
31239,
11303,
413,
4914,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33448,
38579,
13240,
259,
367,
30570,
9038,
198,
2,
198,
2,
44386,
17168,
5964,
198,
2,
198,
2,
2448,
3411,
318,
29376,
75... | 3.680124 | 322 |
from django.urls import path, re_path, include
from rest_framework.routers import DefaultRouter
from rest_framework.urlpatterns import format_suffix_patterns
from products.api.views import OptionModelViewSet, CategoryModelViewSet, ProductModelViewSet, BrandModelViewSet, \
CartView, CartViewId, WishView, WishViewId... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
302,
62,
6978,
11,
2291,
198,
6738,
1334,
62,
30604,
13,
472,
1010,
1330,
15161,
49,
39605,
198,
6738,
1334,
62,
30604,
13,
6371,
33279,
82,
1330,
5794,
62,
37333,
844,
62,
33279,
82... | 3.067164 | 402 |
from django.http import HttpResponse
from django.shortcuts import render
import datetime
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect
from django.urls import reverse
from . import forms
| [
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
628,
198,
11748,
4818,
8079,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
651,
62,
15252,
62,
273,
62,
26429,
19... | 3.602941 | 68 |
import datetime
import itertools
import json
import os
from collections import defaultdict
import numpy as np
from qlink.utils import merge_dicts, rearrange_list
from pathos.multiprocessing import Pool
from qlink.log_functions import start_message, finish_message
| [
11748,
4818,
8079,
198,
11748,
340,
861,
10141,
198,
11748,
33918,
198,
11748,
28686,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
10662,
8726,
13,
26791,
1330,
20121,
62,
11600,
82,
11,
37825,
... | 3.608108 | 74 |
from network.loss import YoloLoss
from unittest import TestCase
import numpy as np
import torch
from torch.utils.data import DataLoader
from network.transforms import img_transformer
from network.dataset import VOCDataset
from network.models import YoloResnetv1
from network.models import YoloDarknetv1
import matplotlib... | [
6738,
3127,
13,
22462,
1330,
575,
14057,
43,
793,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
6738,
3127,
13,
7645,
... | 2.678715 | 249 |
from flask_wtf import Form
from wtforms import StringField, DateTimeField, SubmitField
from wtforms.validators import DataRequired
| [
6738,
42903,
62,
86,
27110,
1330,
5178,
198,
6738,
266,
83,
23914,
1330,
10903,
15878,
11,
7536,
7575,
15878,
11,
39900,
15878,
198,
6738,
266,
83,
23914,
13,
12102,
2024,
1330,
6060,
37374,
198
] | 3.852941 | 34 |
''' Control global configuration options with environment variables.
'''
from __future__ import absolute_import
import codecs
import logging
import os
from os.path import join, abspath, isdir
from .util.paths import ROOT_DIR, bokehjsdir
class Settings(object):
''' A class to collect global, overridable Bokeh c... | [
7061,
6,
6779,
3298,
8398,
3689,
351,
2858,
9633,
13,
198,
198,
7061,
6,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
40481,
82,
198,
11748,
18931,
198,
11748,
28686,
198,
6738,
28686,
13,
6978,
1330,
4654,
11... | 2.464699 | 4,065 |
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
13130,
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... | 3.357333 | 375 |
#!/usr/bin/env python
'''Add a URL to (or just open) Google bookmarks.'''
from HTMLParser import HTMLParser
from urllib import urlopen, urlencode
import webbrowser
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
4550,
257,
10289,
284,
357,
273,
655,
1280,
8,
3012,
1492,
14306,
2637,
7061,
198,
198,
6738,
11532,
46677,
1330,
11532,
46677,
198,
6738,
2956,
297,
571,
1330,
19016,
9654,
1... | 2.971429 | 70 |
import logging
from spaceone.core.manager import BaseManager
from spaceone.identity.lib.cipher import PasswordCipher
from spaceone.identity.model.domain_owner_model import DomainOwner
_LOGGER = logging.getLogger(__name__)
| [
11748,
18931,
198,
198,
6738,
2272,
505,
13,
7295,
13,
37153,
1330,
7308,
13511,
198,
6738,
2272,
505,
13,
738,
414,
13,
8019,
13,
66,
10803,
1330,
30275,
34,
10803,
198,
6738,
2272,
505,
13,
738,
414,
13,
19849,
13,
27830,
62,
1840... | 3.461538 | 65 |
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 28 11:37:46 2022
@author: timsc
"""
##todo: add gametime variable
##change names of tackling game attributes
#%%imports
import xml.etree.ElementTree as ET
import pandas as pd
#%%load
# parse an xml file by name
tree = ET.parse(r'final-snippets/xml/DFL-MAT-003CPG_188.95_... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
2892,
1526,
2579,
1367,
25,
2718,
25,
3510,
33160,
198,
198,
31,
9800,
25,
4628,
1416,
198,
37811,
198,
198,
2235,
83,
24313,
25,
751,
9106,
80... | 2.45089 | 1,517 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- Python -*-
"""
Chat program
ROSPEEXから
入力された文章を使い、DoCoMoAPIで会話する
The project is hosted on GitHub where your could fork the project or report
issues. Visit https://github.com/roboworks/
:copyright: (c) 2015 by Hiroyuki Okada, All rights reserv... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
532,
9,
12,
11361,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
24101,
1430,
628,
220,
220,
220,
48263,
11401,
63... | 2.037234 | 1,880 |
n = int(input())
ans = 7
if n > 100:
ans += (n-100)*5 + 160
elif n > 30:
ans += (n-30)*2 + 20
elif n > 10:
ans += (n-10) * 1
print(ans) | [
77,
796,
493,
7,
15414,
28955,
201,
198,
504,
796,
767,
201,
198,
361,
299,
1875,
1802,
25,
201,
198,
220,
220,
220,
9093,
15853,
357,
77,
12,
3064,
27493,
20,
1343,
13454,
201,
198,
417,
361,
299,
1875,
1542,
25,
201,
198,
220,
... | 1.845238 | 84 |
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey has `on_delete` set to the desired behavior.
# * Remove `managed = False` lines if ... | [
2,
770,
318,
281,
8295,
12,
27568,
37770,
2746,
8265,
13,
198,
2,
921,
1183,
423,
284,
466,
262,
1708,
14500,
284,
3424,
428,
510,
25,
198,
2,
220,
220,
1635,
30144,
9521,
4981,
6,
1502,
198,
2,
220,
220,
1635,
6889,
1654,
1123,
... | 3.550265 | 189 |
a = CoordinateRow([(5,4),(4,5),(8,7)])
a.interlace(CoordinateRow([(6,3),(3,2),(9,6),(4,3)]))
print(a.row) | [
198,
198,
64,
796,
22819,
4559,
25166,
26933,
7,
20,
11,
19,
828,
7,
19,
11,
20,
828,
7,
23,
11,
22,
8,
12962,
198,
64,
13,
3849,
27077,
7,
7222,
45480,
25166,
26933,
7,
21,
11,
18,
828,
7,
18,
11,
17,
828,
7,
24,
11,
21,
... | 1.725806 | 62 |
from gensim.models.keyedvectors import KeyedVectors
import os
dir = os.path.dirname(__file__)
DIMENSIONS = 300
GLOVE_PATH = '../../data/glove.6B/glove.6B.%sd.txt' % DIMENSIONS
word_vectors = KeyedVectors.load_word2vec_format(os.path.join(dir, GLOVE_PATH), binary=False)
empty = {
"title": "null",
"similarity": 0... | [
6738,
308,
641,
320,
13,
27530,
13,
2539,
276,
303,
5217,
1330,
7383,
276,
53,
478,
669,
198,
11748,
28686,
198,
198,
15908,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
8,
198,
198,
35,
3955,
16938,
11053,
796,
5867,
... | 2.323741 | 139 |
# -*- coding:utf-8 -*-
"""
Verion: 1.0
Since : 3.6
Author: zhangjian
Site: https://iliangqunru.bitcron.com/
File: f_cccs_structure_gen
Time: 2018/7/24
Add New Functional f_cccs_structure_gen
"""
import json
import os
import sys
PY3 = False
if sys.version > '3':
PY3 = True
# 结构化后json数据文件
TARGET_JSON =... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
4643,
295,
25,
352,
13,
15,
198,
4619,
1058,
513,
13,
21,
198,
6434,
25,
1976,
33255,
73,
666,
198,
14413,
25,
3740,
1378,
2403,
648,
80,
403,
622,
13,... | 2.148936 | 188 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Osman Baskaya"
"""
Script that calculate absolute difference between different systems"
Example: python absolute-diff.py 3 s13-test-globalcontext-svm-scores.txt s13-test-glove-svm-scores.txt s13-test-multilingual-svm-scores.txt s13-test-orig-XYw-svm-scores.txt
"... | [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
834,
9800,
834,
796,
366,
16748,
805,
347,
2093,
11729,
1,
198,
198,
37811,
198,
7391,
326,
15284,
4112,
3580,
1022,
1180,... | 2.601173 | 341 |
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
| [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
628,
628,
628,
628,
628,
628,
628
] | 3.266667 | 30 |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 28 11:45:40 2017
### Algorithm Set for Bluenose Data Processing
#FUNCTION: ProcessBinFile()
INPUT:
OUTPUT: m * n * 2000 signal matrices
#FUNCTION: calliperAlg()
INPUT: m * n * 2000 signal matrices
OUTPUT : m * n calliper MAP
@author: chens
"""
import nu... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
2556,
2579,
1367,
25,
2231,
25,
1821,
2177,
198,
21017,
978,
42289,
5345,
329,
12391,
268,
577,
6060,
28403,
198,
198,
2,
42296,
4177,
284... | 2.787565 | 193 |
"""Console script for modern-python-boilerplate."""
import click
from modern_python_boilerplate import __version__
@click.command()
@click.version_option(version=__version__)
def main() -> int:
"""Console script for modern-python-boilerplate."""
click.echo("This is the cli for the modern_python_boilerplate p... | [
37811,
47581,
4226,
329,
3660,
12,
29412,
12,
2127,
5329,
6816,
526,
15931,
198,
11748,
3904,
198,
198,
6738,
3660,
62,
29412,
62,
2127,
5329,
6816,
1330,
11593,
9641,
834,
628,
198,
31,
12976,
13,
21812,
3419,
198,
31,
12976,
13,
964... | 3.017241 | 174 |
#!/usr/bin/python3
from ABE_ADCPi import ADCPi
from ABE_helpers import ABEHelpers
import datetime
import time
"""
================================================
ABElectronics ADC Pi 8-Channel ADC data-logger demo
Version 1.0 Created 29/02/2015
Requires python 3 smbus to be installed
run with: python3 demo-read_vol... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
6738,
44013,
62,
2885,
8697,
72,
1330,
5984,
8697,
72,
198,
6738,
44013,
62,
16794,
364,
1330,
44013,
12621,
19276,
198,
11748,
4818,
8079,
198,
11748,
640,
198,
198,
37811,
198,
100... | 2.703863 | 466 |
#!/usr/bin/env python3
import os
import socket
import modules
import logging
import re as regex
from time import sleep
from threading import Thread
from ipaddress import ip_address
from importlib import import_module
from tendo import singleton as Check
from config import LogProfile, LoadConfig
from pyotrs import Artic... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
28686,
198,
11748,
17802,
198,
11748,
13103,
198,
11748,
18931,
198,
11748,
302,
355,
40364,
198,
6738,
640,
1330,
3993,
198,
6738,
4704,
278,
1330,
14122,
198,
6738,
20966,
2... | 3.019753 | 405 |
from Cryptodome.Cipher import AES
import base64
| [
6738,
15126,
375,
462,
13,
34,
10803,
1330,
34329,
198,
11748,
2779,
2414,
198
] | 3.428571 | 14 |
import random
update_url = ['https://media.giphy.com/media/rl0FOxdz7CcxO/giphy.gif', 'https://media.giphy.com/media/1fgI4bZpCo9S57r4Vd/giphy.gif', 'https://media.giphy.com/media/3o7bu3XilJ5BOiSGic/giphy.gif',\
'https://media.giphy.com/media/cnzP4cmBsiOrccg20V/giphy.gif', 'https://media.giphy.com/media/y1ZBcOGOO... | [
11748,
4738,
201,
198,
201,
198,
19119,
62,
6371,
796,
37250,
5450,
1378,
11431,
13,
70,
541,
12114,
13,
785,
14,
11431,
14,
45895,
15,
6080,
24954,
89,
22,
34,
66,
87,
46,
14,
70,
541,
12114,
13,
27908,
3256,
705,
5450,
1378,
114... | 1.871795 | 1,443 |
#!/usr/bin/env python3
# https://codeforces.com/problemset/problem/987/B
# https://codeforces.com/blog/entry/59758
# 求f=ln(x)/x的导数,看f的曲线
# 思路1: 实现所有情况的逻辑
# 思路2: 调用实际函数ln(x)/x
# 思路3: 构建一个函数代替ln(x)/x
l = list(map(int,input().split()))
print(f(l))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
3740,
1378,
19815,
891,
273,
728,
13,
785,
14,
1676,
22143,
316,
14,
45573,
14,
44183,
14,
33,
198,
2,
3740,
1378,
19815,
891,
273,
728,
13,
785,
14,
14036,
14,
13000,
... | 1.306878 | 189 |
default_setting = {
'global':{
'key':''
},
'flask':{
'key':'[,,,,]',
'time':'[,,,,]'
},
'buff':{
'key':'[,,,,]',
'time':'[,,,,]'
},
'trigger':{
'key':'[,,]'
}
} | [
12286,
62,
33990,
796,
1391,
198,
220,
220,
220,
705,
20541,
10354,
90,
198,
220,
220,
220,
220,
220,
220,
220,
705,
2539,
10354,
7061,
198,
220,
220,
220,
8964,
198,
220,
220,
220,
705,
2704,
2093,
10354,
90,
198,
220,
220,
220,
... | 1.610738 | 149 |
import numpy as np
from .constants import CONSTANTS
__all__ = [
'q_from_b',
'b_from_q',
'q_from_g',
'g_from_q',
'b_from_g',
'g_from_b'
]
def q_from_b(
b, delta, Delta
):
"""Compute q-value from b-value. Units are standard units."""
tau = Delta - delta / 3
q = np.sqrt(b / tau)... | [
11748,
299,
32152,
355,
45941,
198,
6738,
764,
9979,
1187,
1330,
7102,
2257,
1565,
4694,
628,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
80,
62,
6738,
62,
65,
3256,
198,
220,
220,
220,
705,
65,
62,
6738,
62,
80,
3256,
... | 2.366044 | 642 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from behave import *
import json
import os
import glob
from helpers.http import Request
@then('snapshot {tenant}/{account} version {version} should be')
@then('{tenant}/{account} should have data integrity')
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
17438,
1330,
1635,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
15095,
198,
6738,
49385,
13,
4023,
... | 3.023256 | 86 |
# Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the COPYING file.
""" Tools for the GNU debugger
"""
import os
import subprocess
from qisys import ui
import qisys.sh
import qisys.command
def contains_debug_info(f... | [
2,
15069,
357,
66,
8,
2321,
12,
7908,
8297,
28650,
47061,
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,
27975,
45761,
2393,
... | 2.420043 | 938 |
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
from .provider import AtlassianProvider
urlpatterns = default_urlpatterns(AtlassianProvider) | [
6738,
477,
18439,
13,
14557,
23317,
13,
15234,
4157,
13,
12162,
1071,
17,
13,
6371,
82,
1330,
4277,
62,
6371,
33279,
82,
198,
6738,
764,
15234,
1304,
1330,
5234,
46091,
29495,
198,
198,
6371,
33279,
82,
796,
4277,
62,
6371,
33279,
82,... | 3.595745 | 47 |
import os
from setuptools import setup, find_packages
setup(
name = "django-user-metrics",
version = "0.1",
description = "capture metrics for each user",
long_description = read('README.rst'),
url = 'https://github.com/rmaceissoft/django-user-metrics',
author = 'Reiner Marquez',
author_ema... | [
11748,
28686,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
796,
366,
28241,
14208,
12,
7220,
12,
4164,
10466,
1600,
198,
220,
220,
220,
2196,
796,
366,
15,
13,
16,
1600... | 2.683673 | 294 |
# Copyright 2015 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.
# Path where remote_file_reader should be installed on the device.
REMOTE_FILE_READER_DEVICE_PATH = '/data/local/tmp/remote_file_reader'
# Path where remote... | [
2,
15069,
1853,
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,
2,
... | 3.328244 | 131 |
import pandas as pd
import numpy as np
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198
] | 3 | 13 |
#! /usr/bin/env python
import collections
import datetime
import time
import channel
import config
import user
import utils
| [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
17268,
198,
11748,
4818,
8079,
198,
11748,
640,
198,
198,
11748,
6518,
198,
11748,
4566,
198,
11748,
2836,
198,
11748,
3384,
4487,
628
] | 3.628571 | 35 |
# -*- coding: utf-8 -*-
# @File : file.py
# @Date : 2021/4/1
# @Desc :
import os
import shutil
from django.conf import settings
from Lib.configs import MSFLOOT
TMP_DIR = os.path.join(settings.BASE_DIR, 'STATICFILES', 'TMP')
class File(object):
"""文件,目录相关API"""
@staticmethod
@staticmethod
@sta... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
8979,
220,
1058,
2393,
13,
9078,
198,
2,
2488,
10430,
220,
1058,
33448,
14,
19,
14,
16,
198,
2,
2488,
24564,
220,
1058,
198,
11748,
28686,
198,
11748,
4423,
... | 2.281046 | 153 |
from bs4 import BeautifulSoup as BS
import requests
if __name__ == "__main__":
main()
| [
6738,
275,
82,
19,
1330,
23762,
50,
10486,
355,
24218,
198,
11748,
7007,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.848485 | 33 |
"""Test special behavior for accessing user comment EXIF attribute."""
import binascii
import os
import textwrap
import unittest
from baseline import Baseline
from exif import Image
from .modify_exif_baselines import MODIFY_USER_COMMENT_BASELINE
class TestUserComment(unittest.TestCase):
"""Test special behavi... | [
37811,
14402,
2041,
4069,
329,
22534,
2836,
2912,
7788,
5064,
11688,
526,
15931,
198,
198,
11748,
9874,
292,
979,
72,
198,
11748,
28686,
198,
11748,
2420,
37150,
198,
11748,
555,
715,
395,
198,
198,
6738,
14805,
1330,
6455,
4470,
198,
1... | 2.492102 | 823 |
"""
Django settings for Animals project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
... | [
37811,
198,
35,
73,
14208,
6460,
329,
25390,
1628,
13,
198,
198,
8645,
515,
416,
705,
28241,
14208,
12,
28482,
923,
16302,
6,
1262,
37770,
352,
13,
1157,
13,
198,
198,
1890,
517,
1321,
319,
428,
2393,
11,
766,
198,
5450,
1378,
31628... | 2.354936 | 1,327 |
from custom_components.smartbox.const import (
DOMAIN,
CONF_ACCOUNTS,
CONF_API_NAME,
CONF_BASIC_AUTH_CREDS,
CONF_DEVICE_IDS,
CONF_PASSWORD,
CONF_USERNAME,
)
MOCK_CONFIG_1 = {
DOMAIN: {
CONF_ACCOUNTS: [
{
CONF_API_NAME: "test_api_name_1",
... | [
6738,
2183,
62,
5589,
3906,
13,
27004,
3524,
13,
9979,
1330,
357,
198,
220,
220,
220,
24121,
29833,
11,
198,
220,
220,
220,
7102,
37,
62,
26861,
19385,
4694,
11,
198,
220,
220,
220,
7102,
37,
62,
17614,
62,
20608,
11,
198,
220,
22... | 1.614035 | 969 |
from shape import Shape
from point import Point
class Square(Shape):
"""
A square Shape.
"""
def __init__(self, corners):
"""
Create Square self with vertices corners.
Assume all sides are equal and corners are square.
@param Square self: this Square object
@... | [
6738,
5485,
1330,
25959,
198,
6738,
966,
1330,
6252,
628,
198,
4871,
9276,
7,
33383,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
6616,
25959,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
15003,
834,
7... | 2.268344 | 477 |
# -*- coding: utf-8 -*-
# OPENID URLS
URL_WELL_KNOWN = "realms/{realm-name}/.well-known/openid-configuration"
URL_TOKEN = "realms/{realm-name}/protocol/openid-connect/token"
URL_USERINFO = "realms/{realm-name}/protocol/openid-connect/userinfo"
URL_LOGOUT = "realms/{realm-name}/protocol/openid-connect/logout"
URL_CERTS... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
38303,
2389,
37902,
6561,
198,
21886,
62,
8845,
3069,
62,
44706,
796,
366,
5305,
907,
14,
90,
5305,
76,
12,
3672,
92,
11757,
4053,
12,
4002,
14,
9654,
312,
1... | 2.22198 | 919 |
"""Unit tests for pyatv.core.facade."""
import asyncio
import inspect
from ipaddress import IPv4Address
import math
from typing import Any, Dict, Set
from unittest.mock import MagicMock
import pytest
from pyatv import exceptions
from pyatv.conf import AppleTV
from pyatv.const import DeviceState, FeatureName, MediaTyp... | [
37811,
26453,
5254,
329,
12972,
265,
85,
13,
7295,
13,
38942,
671,
526,
15931,
198,
11748,
30351,
952,
198,
11748,
10104,
198,
6738,
20966,
21975,
1330,
25961,
19,
20231,
198,
11748,
10688,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11... | 2.888372 | 430 |
from src.problems.problem import Problem
from dataclasses import dataclass
import numpy as np
@dataclass
@dataclass
@dataclass
| [
6738,
12351,
13,
1676,
22143,
13,
45573,
1330,
20647,
201,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
31,
19608,
330,
31172,
201,
198,
201,
198,
31,
19608,
330,
31... | 2.705882 | 51 |
import re
import yaml
from utils import setting as _setting
from utils import cmd as _cmd
from utils.config import config
from package.package import Package, PackageFactory
from package.scanner import Scanner, ScannerFactory
from package.signature import Signature, SignatureFactory
| [
11748,
302,
198,
11748,
331,
43695,
198,
198,
6738,
3384,
4487,
1330,
4634,
355,
4808,
33990,
198,
6738,
3384,
4487,
1330,
23991,
355,
4808,
28758,
198,
6738,
3384,
4487,
13,
11250,
1330,
4566,
198,
198,
6738,
5301,
13,
26495,
1330,
157... | 4.114286 | 70 |
#!/usr/bin/env python3
import sys # 명령창과 연결하는 기능
# 명령창 : python Day06-01.py 파라미터1 파라미터2 ....
input_file =sys.argv[1]
output_file = sys.argv[2]
filereader = open(input_file, 'r', newline='')
filewriter = open(input_file, 'w', newline='')
header = filereader.readline()
print(header)
filereader.close()
filewri... | [
2,
48443,
14629,
14,
8800,
14,
24330,
220,
21015,
18,
198,
11748,
220,
25064,
220,
1303,
31619,
103,
227,
167,
254,
117,
168,
108,
121,
166,
111,
120,
23821,
245,
108,
166,
110,
108,
47991,
246,
167,
232,
242,
220,
166,
116,
108,
... | 1.756614 | 189 |
#!/usr/bin/env python
"""
Vessel CLI Tool
* Usage: python vessel.py
*
* Command Line Arguments
*
* make:repo name eg. python vessel.py make:repo user
* make:blueprint name eg. python vessel.py make:blueprint vendors [--url_prefix=vendors]
* make:controller name eg. python vessel.py make:controller user
* make:test name... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
53,
7878,
43749,
16984,
198,
9,
29566,
25,
21015,
8837,
13,
9078,
198,
9,
198,
9,
9455,
6910,
20559,
2886,
198,
9,
198,
9,
197,
15883,
25,
260,
7501,
1438,
29206,
13,
2... | 2.328778 | 1,317 |
import discord
from discord.ext import commands
from enjin_api import EnjinWrapper
import textwrap
from datetime import datetime, timedelta
import pytz
import asyncio
from gspread_api import GoogleHelperSheet
| [
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
551,
18594,
62,
15042,
1330,
2039,
18594,
36918,
2848,
198,
11748,
2420,
37150,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
11748,
12972,
22877,
198,
117... | 3.77193 | 57 |
from typing import DefaultDict
with open('src/day4/input.txt') as f:
lines = [l.rstrip() for l in f.readlines()]
draws = [int(d) for d in lines[0].split(',')]
boards = []
for idx in range(2, len(lines)-2, 6):
number_grid = [[int(el) for el in row.split()] for row in lines[idx:idx+5]]
... | [
6738,
19720,
1330,
15161,
35,
713,
628,
198,
198,
4480,
1280,
10786,
10677,
14,
820,
19,
14,
15414,
13,
14116,
11537,
355,
277,
25,
198,
220,
220,
220,
3951,
796,
685,
75,
13,
81,
36311,
3419,
329,
300,
287,
277,
13,
961,
6615,
34... | 2.310909 | 550 |
import os.path
import pytest
pytest_plugins = [
'mypy.test.data',
]
| [
11748,
28686,
13,
6978,
198,
198,
11748,
12972,
9288,
198,
198,
9078,
9288,
62,
37390,
796,
685,
198,
220,
220,
220,
705,
1820,
9078,
13,
9288,
13,
7890,
3256,
198,
60,
628
] | 2.34375 | 32 |
"""
Average Directional Index indicator
"""
import pandas
import numpy
from analyzers.utils import IndicatorUtils
| [
198,
37811,
198,
26287,
41837,
282,
12901,
16916,
198,
37811,
198,
198,
11748,
19798,
292,
198,
11748,
299,
32152,
198,
198,
6738,
4284,
47031,
13,
26791,
1330,
1423,
26407,
18274,
4487,
628
] | 3.6875 | 32 |
import shutil
import pathlib
import os
move = FileMover('C:\\Users\\smushwan\\Desktop\\one')
move.move_files()
| [
11748,
4423,
346,
201,
198,
11748,
3108,
8019,
201,
198,
11748,
28686,
201,
198,
201,
198,
201,
198,
201,
198,
21084,
796,
9220,
44,
2502,
10786,
34,
25,
6852,
14490,
6852,
5796,
1530,
8149,
6852,
36881,
6852,
505,
11537,
201,
198,
21... | 2.489796 | 49 |
import importlib
import logging
from mayan.apps.document_states import storages
from mayan.apps.smart_settings.tests.mixins import SmartSettingTestMixin
from mayan.apps.storage.classes import DefinedStorage
from mayan.apps.testing.tests.base import BaseTestCase
from ..literals import STORAGE_NAME_WORKFLOW_CACHE
from ... | [
11748,
1330,
8019,
198,
11748,
18931,
198,
198,
6738,
743,
272,
13,
18211,
13,
22897,
62,
27219,
1330,
336,
273,
1095,
198,
6738,
743,
272,
13,
18211,
13,
27004,
62,
33692,
13,
41989,
13,
19816,
1040,
1330,
10880,
34149,
14402,
35608,
... | 3.555556 | 108 |
import numpy as np
import torch
import torch.nn.functional as F
from torch.utils.data.sampler import Sampler
from torchvision.datasets import ImageFolder
from tqdm import *
class ClassBalancedBatchSampler(Sampler):
"""
BatchSampler that ensures a fixed amount of images per class are sampled in the minibatch
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
26791,
13,
7890,
13,
37687,
20053,
1330,
3409,
20053,
198,
6738,
28034,
10178,
13,
19608,
292,
1039,
1330,
7412,
... | 3.385417 | 96 |
from Section18_Memento.RegularMemento.Memento import Memento
| [
6738,
7275,
1507,
62,
44,
972,
78,
13,
40164,
44,
972,
78,
13,
44,
972,
78,
1330,
337,
972,
78,
628
] | 2.952381 | 21 |
import numpy as np
import os, sys, cv2, tarfile, zipfile
from itertools import combinations
import six.moves.urllib as urllib
import tensorflow as tf
from distutils.version import StrictVersion
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Ima... | [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
28686,
11,
25064,
11,
269,
85,
17,
11,
13422,
7753,
11,
19974,
7753,
201,
198,
6738,
340,
861,
10141,
1330,
17790,
220,
201,
198,
11748,
2237,
13,
76,
5241,
13,
333,
297,
571,
355,
295... | 2.222353 | 1,700 |
# -*- coding: utf-8 -*-
import logging
from dwi_ml.models.direction_getter_models import keys_to_direction_getters
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
18931,
198,
198,
6738,
288,
37686,
62,
4029,
13,
27530,
13,
37295,
62,
1136,
353,
62,
27530,
1330,
8251,
62,
1462,
62,
37295,
62,
1136,
1010,
628,
198
] | 2.744186 | 43 |
import datetime
import pickle
import time
import numpy as np
import tensorflow as tf
def stack_data(data, num_shifts, len_time):
"""Stack data from a 2D array into a 3D array.
Arguments:
data -- 2D data array to be reshaped
num_shifts -- number of shifts (time steps) that losses... | [
11748,
4818,
8079,
201,
198,
11748,
2298,
293,
201,
198,
11748,
640,
201,
198,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
11192,
273,
11125,
355,
48700,
201,
198,
201,
198,
201,
198,
4299,
8931,
62,
7890,
7,
7890,
11,
... | 2.288162 | 9,748 |
""" To draw transition matrix """
import numpy as np
import seaborn as sns
import networkx as nx
from networkx.drawing.nx_agraph import to_agraph
from .figure11 import lapt_tHMMobj_list
from .figure12 import gemc_tHMMobj_list
from .figureCommon import getSetup, subplotLabel
gemc = gemc_tHMMobj_list[0]
lapt = lapt_tHM... | [
37811,
1675,
3197,
6801,
17593,
37227,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
11748,
3127,
87,
355,
299,
87,
198,
6738,
3127,
87,
13,
19334,
278,
13,
77,
87,
62,
6111,
1330,
284,
62,
6111... | 2.376607 | 778 |
import os
| [
11748,
28686,
628
] | 3.666667 | 3 |
from configs import cfg
from src.utils.record_log import _logger
import tensorflow as tf
from src.model.model_template import ModelTemplate
from src.nn_utils.nn import linear, bn_dense_layer
from src.nn_utils.integration_func import generate_embedding_mat, multi_dimensional_attention, \
directional_attention_with_... | [
6738,
4566,
82,
1330,
30218,
70,
198,
6738,
12351,
13,
26791,
13,
22105,
62,
6404,
1330,
4808,
6404,
1362,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
12351,
13,
19849,
13,
19849,
62,
28243,
1330,
9104,
30800,
198,
6738,
... | 3.257426 | 101 |
# -*- coding: utf-8 -*-
from acrylamid.utils import Metadata, neighborhood
import attest
tt = attest.Tests()
@tt.test
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
936,
563,
2543,
312,
13,
26791,
1330,
3395,
14706,
11,
6232,
198,
198,
11748,
44477,
198,
926,
796,
44477,
13,
51,
3558,
3419,
628,
198,
198,
31,
926,
13,
... | 2.617021 | 47 |
#Functions to plot a grid of fugacity values for a range of temperatures and pressures.
import numpy as np
import matplotlib.pyplot as plt
#from scipy.constants.constants import C2K, K2C
from scipy.constants import convert_temperature
from scipy import optimize as opt # for optimization
from fugacity_calculator impor... | [
198,
2,
24629,
2733,
284,
7110,
257,
10706,
286,
31497,
4355,
3815,
329,
257,
2837,
286,
10101,
290,
18895,
13,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
2,
6738,
629,
... | 3.381818 | 110 |