content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# -*- coding: utf-8 -
#
# This file is part of dj-webmachine released under the MIT license.
# See the NOTICE for more information.
from django.template import loader, RequestContext
from django.utils.encoding import iri_to_uri
try:
from restkit import oauth2
except ImportError:
raise ImportError("restkit>=3.... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
42625,
12,
12384,
30243,
2716,
739,
262,
17168,
5964,
13,
198,
2,
4091,
262,
28536,
329,
517,
1321,
13,
198,
198,
6738,
42625,
14208,
13,... | 3.363636 | 154 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from commands.basecommand import BaseCommand
import re
| [
2,
15069,
357,
66,
8,
5413,
10501,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
198,
198,
6738,
9729,
13,
8692,
21812,
1330,
7308,
21575,
198,
11748,
302,
628,
628,
628,
628
] | 4.121212 | 33 |
# stdlib
import re
from typing import Union, no_type_check
# 3rd party
import click
import pytest
from _pytest.capture import CaptureResult
from coincidence.regressions import AdvancedDataRegressionFixture, AdvancedFileRegressionFixture
from coincidence.selectors import max_version, min_version, not_pypy, only_pypy
fr... | [
2,
14367,
8019,
198,
11748,
302,
198,
6738,
19720,
1330,
4479,
11,
645,
62,
4906,
62,
9122,
198,
198,
2,
513,
4372,
2151,
198,
11748,
3904,
198,
11748,
12972,
9288,
198,
6738,
4808,
9078,
9288,
13,
27144,
495,
1330,
31793,
23004,
198,... | 3.013333 | 375 |
import copy
import logging
import shutil
from math import exp
import numpy as np
from sklearn.preprocessing import StandardScaler, normalize
from sklearn.utils import shuffle
from tqdm import trange
from lib.bqueue import Bqueue
from lib.dnn import Dnn
from lib.helper import Helper
from lib.som import SOM
logging.basi... | [
11748,
4866,
198,
11748,
18931,
198,
11748,
4423,
346,
198,
6738,
10688,
1330,
1033,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
3866,
36948,
1330,
8997,
3351,
36213,
11,
3487,
1096,
198,
6738,
1341,
35720,
13,
26791,
... | 3.313433 | 134 |
from django.conf.urls.defaults import *
from views import home
urlpatterns = patterns('',
url(r'^$', home, name='home'),
url('fandjango/', include('fandjango.urls'))
)
| [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
13,
12286,
82,
1330,
1635,
198,
198,
6738,
5009,
1330,
1363,
198,
198,
6371,
33279,
82,
796,
7572,
10786,
3256,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
3,
3256,
1363,
11,
1438,
11639,
... | 2.521127 | 71 |
from quart import Quart, flask_patch
from app.main import main
from .extinsions import db
| [
6738,
28176,
1330,
48748,
11,
42903,
62,
17147,
198,
6738,
598,
13,
12417,
1330,
1388,
198,
6738,
764,
2302,
1040,
507,
1330,
20613,
628
] | 3.791667 | 24 |
import re
import signal
import sys
from threading import Thread
import pychess
from pychess.Players.PyChess import PyChess
from pychess.System import conf, fident
from pychess.Utils.book import getOpenings
from pychess.Utils.const import (
NORMALCHESS,
FEN_START,
BLACK,
FISCHERRANDOMCHESS,
CRAZYHOU... | [
11748,
302,
198,
11748,
6737,
198,
11748,
25064,
198,
6738,
4704,
278,
1330,
14122,
198,
198,
11748,
12972,
2395,
824,
198,
6738,
12972,
2395,
824,
13,
24860,
13,
20519,
7376,
824,
1330,
9485,
7376,
824,
198,
6738,
12972,
2395,
824,
13,... | 2.432203 | 590 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
198
] | 2.083333 | 24 |
print(Class2.get_user("test"))
| [
4798,
7,
9487,
17,
13,
1136,
62,
7220,
7203,
9288,
48774,
628
] | 2.666667 | 12 |
# -*- coding: utf-8 -*-
import unittest
from cwr.parser.encoder.dictionary import IPIBaseDictionaryEncoder
"""
Acknowledgement to dictionary encoding tests.
The following cases are tested:
"""
__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
555,
715,
395,
198,
198,
6738,
269,
18351,
13,
48610,
13,
12685,
12342,
13,
67,
14188,
1330,
6101,
9865,
589,
35,
14188,
27195,
12342,
198,
198,
37811,
198,
... | 3.053191 | 94 |
# Create example plots for README
import numpy as np
import matplotlib.pyplot as plt
import os.path
create_plot('asu-dark')
create_plot('asu-light')
| [
2,
13610,
1672,
21528,
329,
20832,
11682,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
28686,
13,
6978,
198,
198,
17953,
62,
29487,
10786,
27345,
12,
21953,
11537,
19... | 3.04 | 50 |
# Ultroid - UserBot
# Copyright (C) 2020 TeamUltroid
#
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
"""
✘ Commands Available -
• `{i}grey <reply to any media>`
To make ... | [
2,
6172,
3882,
532,
11787,
20630,
198,
2,
15069,
357,
34,
8,
12131,
4816,
16301,
3882,
198,
2,
198,
2,
770,
2393,
318,
257,
636,
286,
1279,
3740,
1378,
12567,
13,
785,
14,
15592,
16301,
3882,
14,
16301,
3882,
14,
1875,
198,
2,
350... | 2.407455 | 778 |
from clpy.math.misc import * # NOQA
| [
6738,
537,
9078,
13,
11018,
13,
44374,
1330,
1635,
220,
1303,
8005,
48,
32,
198
] | 2.466667 | 15 |
x1 = 2.0
x2 = 3.0
ReLu = lambda x: max(0.0, x)
ReLuDer = lambda x: 1 if x > 0 else 0
error_fn = lambda prediction, target: 0.5 * (target - prediction) ** 2
# input
a1 = x1
a2 = x2
w11 = 0.11
w12 = 0.21
w21 = 0.12
w22 = 0.08
w1o = 0.14
w2o = 0.15
y = 1
n = 0.5
# foward
# layer 1
zh1 = (w11 * a1) + (w12 * a2)
zh... | [
198,
87,
16,
796,
362,
13,
15,
198,
87,
17,
796,
513,
13,
15,
198,
198,
3041,
25596,
796,
37456,
2124,
25,
3509,
7,
15,
13,
15,
11,
2124,
8,
198,
3041,
25596,
28532,
796,
37456,
2124,
25,
352,
611,
2124,
1875,
657,
2073,
657,
... | 1.53668 | 1,295 |
""" Representation class for CDB data
"""
import pickle
import numpy as np
from scipy.sparse import dok_matrix
#from gensim.matutils import unitvec
from medcat.utils.matutils import unitvec, sigmoid
from medcat.utils.attr_dict import AttrDict
from medcat.utils.loggers import basic_logger
import os
import pandas as pd
... | [
37811,
10858,
341,
1398,
329,
6458,
33,
1366,
198,
37811,
198,
11748,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
82,
29572,
1330,
466,
74,
62,
6759,
8609,
198,
2,
6738,
308,
641,
320,
13,
6759,
26791... | 1.940701 | 10,017 |
from .scope import Scope
import socket
import json
| [
6738,
764,
29982,
1330,
41063,
198,
11748,
17802,
198,
11748,
33918,
628
] | 4.333333 | 12 |
# Copyright 2016 Ifwe Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | [
2,
15069,
1584,
1002,
732,
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,
13,
198,
2,
921,
... | 3.741117 | 197 |
#!/usr/bin/python3
import sys
import os
import argparse
import traceback
import random
import math
import time
import re
import logging
import colorsys
import json
import tensorflow as tf
import numpy as np
from board import Board
from model import Model
import common
description = """
Play go with a trained neural n... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
1822,
29572,
198,
11748,
12854,
1891,
198,
11748,
4738,
198,
11748,
10688,
198,
11748,
640,
198,
11748,
302,
198,
11748,
18931,
198,
11748,
7577,
... | 2.948435 | 1,086 |
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.rcParams['pdf.fonttype'] = 42
import bluepy
variances = ['0p001', '0p01', '0p05', '0p1', '0p5', '1p0', '1p5', '2p0', '10p0']
bcs = ['/gpfs/bbp.cscs.ch/project/proj9/simulations/nolte/variability/spontaneous/base_seeds_abc... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
198,
6759,
29487,
8019,
13,
1904,
10786,
46384,
11537,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
489,
83,
13,
6015,
10044,
4105,
17816,
12315,
13,
10... | 2.157833 | 849 |
import os
import json
import shutil
from urllib import request
from .utils import PACKAGE_ROOT
from . import __folder_structure_version__
def init_database(database_dir: str = None) -> None:
"""
Creates a basic OpenGenomeBrowser folders structure.
Result:
database
├── organisms
... | [
11748,
28686,
198,
11748,
33918,
198,
11748,
4423,
346,
198,
6738,
2956,
297,
571,
1330,
2581,
198,
6738,
764,
26791,
1330,
47035,
11879,
62,
13252,
2394,
198,
6738,
764,
1330,
11593,
43551,
62,
301,
5620,
62,
9641,
834,
628,
628,
198,
... | 2.426261 | 1,051 |
from .base_dataset import BaseADDataset
from torch.utils.data import DataLoader
class TorchvisionDataset(BaseADDataset):
"""TorchvisionDataset class for datasets already implemented in torchvision.datasets."""
| [
6738,
764,
8692,
62,
19608,
292,
316,
1330,
7308,
2885,
27354,
292,
316,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
628,
198,
4871,
34868,
10178,
27354,
292,
316,
7,
14881,
2885,
27354,
292,
316,
2599,
198,
220,
220,
22... | 3.375 | 64 |
import os
import glob
from pathlib import Path
from .helpers import cached_property
from . import helpers
from . import config
# NOTE:
# For better detection we can add an argument allowing metadata reading
# Exact set of file types needs to be reviewed
class File:
"""File representation"""
@cached_propert... | [
11748,
28686,
198,
11748,
15095,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
764,
16794,
364,
1330,
39986,
62,
26745,
198,
6738,
764,
1330,
49385,
198,
6738,
764,
1330,
4566,
628,
198,
2,
24550,
25,
198,
2,
1114,
1365,
13326,
356,
... | 2.995349 | 215 |
import sys
import requests
import csv
import io
from datetime import datetime
from collections import defaultdict
from .utils import store_data, stoi
# ------------------------------------------------------------------------
# Globals
deaths_URL = "https://raw.githubusercontent.com/datadista/datasets/master/CO... | [
11748,
25064,
198,
11748,
7007,
198,
11748,
269,
21370,
198,
11748,
33245,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
764,
26791,
1330,
3650,
62,
7890,
11,
3995,
72,
198,
198,
2,
16529,... | 2.993976 | 332 |
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2016 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import numpy as np
from pymor.algorithms.timestepping import ExplicitEulerTimeStepper
from pymor.... | [
2,
770,
2393,
318,
636,
286,
262,
12972,
44,
1581,
1628,
357,
4023,
1378,
2503,
13,
9078,
4491,
13,
2398,
737,
198,
2,
15069,
2211,
12,
5304,
12972,
44,
1581,
6505,
290,
20420,
13,
1439,
2489,
10395,
13,
198,
2,
13789,
25,
347,
10... | 2.282562 | 2,810 |
"""
object_adventure.py
A text adventure with objects you can pick up and put down.
"""
# data setup
rooms = {
'empty': {'name': 'an empty room',
'east': 'bedroom', 'north': 'temple',
'contents': [],
'text': 'The stone floors and walls are cold and damp.'},
'temple': {'name': 'a sma... | [
37811,
198,
15252,
62,
324,
5388,
13,
9078,
198,
220,
198,
32,
2420,
8855,
351,
5563,
345,
460,
2298,
510,
290,
1234,
866,
13,
198,
37811,
198,
220,
198,
2,
1366,
9058,
198,
9649,
796,
1391,
198,
220,
220,
220,
705,
28920,
10354,
... | 2.417505 | 994 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. 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... | [
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,
15069,
12131,
41992,
4912,
31703,
15302,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
... | 2.134876 | 4,797 |
"""Example of assigning a variable."""
user_name = input("What is your name? ")
| [
37811,
16281,
286,
38875,
257,
7885,
526,
15931,
198,
7220,
62,
3672,
796,
5128,
7203,
2061,
318,
534,
1438,
30,
366,
8,
198
] | 3.478261 | 23 |
# See LICENSE for licensing information.
#
# Copyright (c) 2021 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import os
import datetime
from shutil import copyfile... | [
2,
4091,
38559,
24290,
329,
15665,
1321,
13,
198,
2,
198,
2,
15069,
357,
66,
8,
33448,
3310,
658,
286,
262,
2059,
286,
3442,
290,
383,
5926,
198,
2,
286,
3310,
658,
329,
262,
10433,
36694,
290,
19663,
5535,
198,
2,
357,
27362,
329... | 2.130776 | 4,718 |
import os
import time
import logging
import numpy
from . import unittest
from sarpy.io.complex.sentinel import SentinelReader
from sarpy.deprecated.io.complex.sentinel import Reader as DepReader
| [
11748,
28686,
198,
11748,
640,
198,
11748,
18931,
198,
11748,
299,
32152,
198,
198,
6738,
764,
1330,
555,
715,
395,
198,
198,
6738,
264,
5117,
88,
13,
952,
13,
41887,
13,
34086,
20538,
1330,
26716,
33634,
198,
6738,
264,
5117,
88,
13,... | 3.431034 | 58 |
from keras.preprocessing.text import Tokenizer
from keras.utils import to_categorical
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import Embedding
from keras.preprocessing.sequence import pad_sequences
from keras.utils import plot_model
# mo... | [
6738,
41927,
292,
13,
3866,
36948,
13,
5239,
1330,
29130,
7509,
198,
6738,
41927,
292,
13,
26791,
1330,
284,
62,
66,
2397,
12409,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
360,
107... | 3.136364 | 132 |
import argparse
| [
11748,
1822,
29572,
198
] | 4 | 4 |
# -*- coding: utf-8 -*-
from collections import defaultdict
import re
import numpy as np
from pyfr.readers import BaseReader, NodalMeshAssembler
from pyfr.readers.nodemaps import GmshNodeMaps
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
17268,
1330,
4277,
11600,
198,
11748,
302,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
12972,
8310,
13,
961,
364,
1330,
7308,
33634,
11,
399,
375... | 2.855072 | 69 |
# -*- encoding: utf-8 -*-
# Copyright (c) 2019 Stephen Bunn <stephen@bunn.io>
# ISC License <https://opensource.org/licenses/isc>
"""
"""
import pytest
from tomlark.parser import Parser
@pytest.fixture
| [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
13130,
7970,
347,
20935,
1279,
9662,
831,
31,
65,
20935,
13,
952,
29,
198,
2,
3180,
34,
13789,
1279,
5450,
1378,
44813,
1668,
13,
2398,
14,
677... | 2.5875 | 80 |
VERSION = 1 # The version number of the format
SECTION_COUNT = 14
| [
43717,
796,
352,
220,
1303,
383,
2196,
1271,
286,
262,
5794,
198,
50,
24565,
62,
34,
28270,
796,
1478,
198
] | 3.35 | 20 |
import subprocess as sp
| [
11748,
850,
14681,
355,
599,
628,
628
] | 3.857143 | 7 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198
] | 1.909091 | 22 |
"""A decorator that allows users to run SQL queries natively in Airflow."""
__version__ = "0.9.1"
# The following line is an import work-around to avoid raising a circular dependency issue related to `create_database`
# Without this, if we run the following imports, in this specific order:
# from astro.databases im... | [
37811,
32,
11705,
1352,
326,
3578,
2985,
284,
1057,
16363,
20743,
6868,
306,
287,
3701,
11125,
526,
15931,
198,
198,
834,
9641,
834,
796,
366,
15,
13,
24,
13,
16,
1,
198,
198,
2,
383,
1708,
1627,
318,
281,
1330,
670,
12,
14145,
28... | 3.441341 | 358 |
# This sample tests the case where a variadic TypeVar is used in
# conjunction with a keyword-only parameter. It also tests protocol
# invariance validation when a TypeVarTuple is used in the protocol
# along with a non-variadic TypeVar.
# pyright: strict
from typing import Protocol, TypeVar
from typing_extensions im... | [
2,
770,
6291,
5254,
262,
1339,
810,
257,
5553,
23876,
5994,
19852,
318,
973,
287,
198,
2,
17856,
351,
257,
21179,
12,
8807,
11507,
13,
632,
635,
5254,
8435,
198,
2,
25275,
590,
21201,
618,
257,
5994,
19852,
51,
29291,
318,
973,
287,... | 3.202454 | 163 |
import unittest
import responses
from dnsimple import DNSimpleException
from dnsimple.response import Pagination
from dnsimple.struct import Contact
from tests.helpers import DNSimpleMockResponse, DNSimpleTest
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
11748,
9109,
198,
198,
6738,
288,
5907,
320,
1154,
1330,
18538,
320,
1154,
16922,
198,
6738,
288,
5907,
320,
1154,
13,
26209,
1330,
31525,
1883,
198,
6738,
288,
5907,
320,
1154,
13,
7249,
1330,
14039,
1... | 3.156627 | 83 |
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'replacedata.views',
# url(r'^$', 'oms.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^repair/history/$', 'repairHistoryDat... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
2291,
11,
19016,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
28482,
13,
2306,
375,
29392,
3419... | 2.595092 | 163 |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 Kyoto University (Hirofumi Inaguma)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Zoneout regularization."""
import torch.nn as nn
| [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
13130,
36298,
2059,
357,
39,
7058,
69,
12994,
554,
363,
7487,
8,
198,
2,
220,
24843,
362,
13,
... | 2.477273 | 88 |
##Problem Description
##The program takes in a number and finds the sum of digits in a number.
print("-------------------Method 1----------------------------------")
temp=n=int(input("Enter a number: "))
total = 0
while n>0 :
total = total+(n%10)
n=n//10
print("The total sum of digits in the number {0} ... | [
2235,
40781,
12489,
201,
198,
2235,
464,
1430,
2753,
287,
257,
1271,
290,
7228,
262,
2160,
286,
19561,
287,
257,
1271,
13,
201,
198,
4798,
7203,
1783,
6329,
17410,
352,
3880,
438,
4943,
201,
198,
29510,
28,
77,
28,
600,
7,
15414,
72... | 3.552239 | 201 |
from rest_framework import exceptions, filters
| [
6738,
1334,
62,
30604,
1330,
13269,
11,
16628,
628
] | 5.333333 | 9 |
"""
AML writer module.
"""
from pymarlin.utils.logger.logging_utils import getlogger
from .base import Writer
class Aml(Writer):
"""
This class implements the Azure ML writer for stats.
"""
def log_scalar(self, k, v, step):
"""
Log metric to AML.
"""
kwargs = {
... | [
37811,
198,
2390,
43,
6260,
8265,
13,
198,
37811,
198,
6738,
12972,
3876,
2815,
13,
26791,
13,
6404,
1362,
13,
6404,
2667,
62,
26791,
1330,
651,
6404,
1362,
198,
6738,
764,
8692,
1330,
26606,
198,
198,
4871,
1703,
75,
7,
34379,
2599,
... | 1.960843 | 332 |
# Definition for singly-linked list.
| [
2,
30396,
329,
1702,
306,
12,
25614,
1351,
13,
628
] | 3.8 | 10 |
for _ in range(int(input())):
n = int(input())
temp = (n - 1) // 26
temp2 = n % 26
ans = 2**temp
if n == 0: print(1,0,0)
elif temp2 > 0 and temp2 < 3: print(ans,0,0)
elif temp2 > 2 and temp2 < 11: print(0,ans,0)
else: print(0,0,ans) | [
1640,
4808,
287,
2837,
7,
600,
7,
15414,
28955,
2599,
198,
197,
77,
796,
493,
7,
15414,
28955,
198,
197,
29510,
796,
357,
77,
532,
352,
8,
3373,
2608,
198,
197,
29510,
17,
796,
299,
4064,
2608,
198,
197,
504,
796,
362,
1174,
29510... | 2.086957 | 115 |
# The problem to be solved:
# We have trucks located in different cities and each truck brings a profit or loss. We have the historical data and determined that the profit depends on the city's population. We want to find this relation.
import numpy as np
print('Welcome to Machine Learning with Python!')
print('Lesso... | [
198,
2,
383,
1917,
284,
307,
16019,
25,
198,
2,
775,
423,
13960,
5140,
287,
1180,
4736,
290,
1123,
7779,
6774,
257,
7630,
393,
2994,
13,
775,
423,
262,
6754,
1366,
290,
5295,
326,
262,
7630,
8338,
319,
262,
1748,
338,
3265,
13,
77... | 2.63671 | 2,626 |
import os
import sys
import colorama
from . import metadata
# project metadata
METADATA = metadata
# paths
PATHS = {}
PATHS["home"] = os.path.expanduser("~")
PATHS["db_file"] = os.path.join(PATHS["home"], ".remindme.db")
PATHS["config_file"] = os.path.join(PATHS["home"], ".remindme")
# colors
colorama.init()
COLO... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
3124,
1689,
198,
6738,
764,
1330,
20150,
628,
198,
2,
1628,
20150,
198,
47123,
2885,
13563,
796,
20150,
628,
198,
2,
13532,
198,
47,
1404,
7998,
796,
23884,
198,
47,
1404,
7998,
14692,
11195,... | 2.672973 | 370 |
# Copyright 2014 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.
from __future__ import absolute_import
import unittest
import mock
from telemetry.core import platform as platform_module
from telemetry.internal.platform i... | [
2,
15069,
1946,
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,
6738,... | 4.123711 | 97 |
#!/usr/bin/env python
import pprint
import os
from django.conf.locale import LANG_INFO
from django.utils import translation
HORIZON_DIR = '/opt/stack/horizon'
langs_horizon = os.listdir(os.path.join(HORIZON_DIR, 'horizon', 'locale'))
langs_dashboard = os.listdir(os.path.join(HORIZON_DIR, 'openstack_dashboard', 'l... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
279,
4798,
198,
11748,
28686,
198,
198,
6738,
42625,
14208,
13,
10414,
13,
17946,
1000,
1330,
406,
15567,
62,
10778,
198,
6738,
42625,
14208,
13,
26791,
1330,
11059,
628,
198... | 2.646789 | 218 |
_ = input()
m = map(int, input().split())
m = sorted(m)
#print(m)
l=[]
for i in range(len(m)):
if(i%2==0):
l.append(str(m[i]))
for i in range(len(m)-1,0,-1):
if(i%2!=0):
l.append(str(m[i]))
print(' '.join(l)) | [
62,
796,
5128,
3419,
198,
76,
796,
3975,
7,
600,
11,
5128,
22446,
35312,
28955,
198,
76,
796,
23243,
7,
76,
8,
198,
2,
4798,
7,
76,
8,
198,
198,
75,
28,
21737,
198,
1640,
1312,
287,
2837,
7,
11925,
7,
76,
8,
2599,
198,
220,
... | 1.766917 | 133 |
#!/usr/bin/env python3
import os
import numpy as np
import pygsp as gsp
import matplotlib.pyplot as plt
from matplotlib.patches import Arc
# plt.rc('font', family='Latin Modern Roman')
plt.rc('text', usetex=True)
plt.rc('text.latex', preamble=r'\usepackage{lmodern}')
fig = plt.figure(figsize = (3, 3))
ax = fig.add_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
28686,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
70,
2777,
355,
308,
2777,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
26... | 2.208494 | 518 |
# By Justin Walgran
# Copyright (c) 2012 Azavea, Inc.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, ... | [
2,
2750,
10799,
6445,
46324,
198,
2,
15069,
357,
66,
8,
2321,
7578,
1015,
64,
11,
3457,
13,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
198,
2,
16727,
257,
4866,
286,
428,
3788,
290,
39... | 3.795337 | 386 |
class EditorAttribute(Attribute,_Attribute):
"""
Specifies the editor to use to change a property. This class cannot be inherited.
EditorAttribute()
EditorAttribute(typeName: str,baseTypeName: str)
EditorAttribute(typeName: str,baseType: Type)
EditorAttribute(type: Type,baseType: Type)
"""
... | [
4871,
12058,
33682,
7,
33682,
11,
62,
33682,
2599,
201,
198,
37227,
201,
198,
18291,
6945,
262,
5464,
284,
779,
284,
1487,
257,
3119,
13,
770,
1398,
2314,
307,
19552,
13,
201,
198,
201,
198,
220,
201,
198,
201,
198,
12058,
33682,
34... | 2.811141 | 736 |
#!/usr/bin/python3
import math
def mysqrt(a):
"""Compute the square root of a using Newton's method: start with an
approximate answer and iteratively improving it
"""
estimate = a / 2 + 1 # Arbitrary estimae of the square root of a
epsilon = 0.0000001
while True:
approx = (estimate + a... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
10688,
198,
198,
4299,
616,
31166,
17034,
7,
64,
2599,
198,
220,
220,
220,
37227,
7293,
1133,
262,
6616,
6808,
286,
257,
1262,
17321,
338,
2446,
25,
923,
351,
281,
198,
220,... | 2.212264 | 848 |
from utils import log
from utils import correlate
import random
| [
6738,
3384,
4487,
1330,
2604,
198,
198,
6738,
3384,
4487,
1330,
39684,
198,
11748,
4738,
198
] | 4.0625 | 16 |
from pathlib import Path
from tests.simulations import BaseSimulationTest
from src.epjson_handler import EPJSON
test_dir = Path(__file__).parent.parent.parent
hot_water_objects = {
"HVACTemplate:Plant:Boiler": {
"Main Boiler": {
"boiler_type": "HotWaterBoiler",
"capacity": "Autosi... | [
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
5254,
13,
14323,
5768,
1330,
7308,
8890,
1741,
14402,
198,
6738,
12351,
13,
538,
17752,
62,
30281,
1330,
14724,
40386,
198,
198,
9288,
62,
15908,
796,
10644,
7,
834,
7753,
834,
737,
8000,
... | 1.487881 | 2,558 |
# Generated by Django 2.0 on 2019-01-31 07:28
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
319,
13130,
12,
486,
12,
3132,
8753,
25,
2078,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.892857 | 28 |
"""
Test suite for BibKey formatting sequences.
Tests the generation of key contents based on the author entry
"""
from zotero_bibtize.bibkey_formatter import KeyFormatter
#
# Test lower author formatting
#
#
# Test upper author formatting
#
#
# Test capitalized author formatting
#
#
# Test abbreviate... | [
37811,
198,
14402,
18389,
329,
43278,
9218,
33313,
16311,
13,
198,
198,
51,
3558,
262,
5270,
286,
1994,
10154,
1912,
319,
262,
1772,
5726,
198,
37811,
198,
198,
6738,
1976,
313,
3529,
62,
65,
571,
83,
1096,
13,
65,
571,
2539,
62,
68... | 3.058935 | 526 |
"""
Classes for exporting entities.
So far only one implementation
"""
import re
external_taxon = re.compile("taxon:([0-9]+)")
internal_taxon = re.compile("NCBITaxon:([0-9]+)")
class EntityWriter():
"""
Abstract superclass of all association writer objects (Gpad, GAF)
"""
# TODO: add to superclass
... | [
37811,
198,
9487,
274,
329,
39133,
12066,
13,
198,
198,
2396,
1290,
691,
530,
7822,
198,
37811,
198,
11748,
302,
198,
198,
22615,
62,
19290,
261,
796,
302,
13,
5589,
576,
7203,
19290,
261,
25,
26933,
15,
12,
24,
60,
28988,
4943,
198... | 2.129489 | 919 |
"""Train a network."""
from .args import Args
from .stats import Stats
from .main import main, train
| [
37811,
44077,
257,
3127,
526,
15931,
198,
6738,
764,
22046,
1330,
943,
14542,
198,
6738,
764,
34242,
1330,
20595,
198,
6738,
764,
12417,
1330,
1388,
11,
4512,
198
] | 3.607143 | 28 |
# Generated by Django 2.2.4 on 2019-10-09 13:20
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
19,
319,
13130,
12,
940,
12,
2931,
1511,
25,
1238,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
#!/usr/bin/python3
if __name__ == '__main__': run()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
1057,
3419,
198
] | 2.304348 | 23 |
#Copyright (C) 2020 Xiao Wang
#License: MIT for academic use.
#Contact: Xiao Wang (wang3702@purdue.edu, xiaowang20140001@gmail.com)
#Some codes adopted from https://github.com/facebookresearch/moco
import os
from ops.argparser import argparser
from ops.Config_Environment import Config_Environment
import torch.multipr... | [
2,
15269,
357,
34,
8,
12131,
28249,
15233,
198,
2,
34156,
25,
17168,
329,
8233,
779,
13,
198,
2,
17829,
25,
28249,
15233,
357,
47562,
20167,
17,
31,
79,
30345,
13,
15532,
11,
2124,
544,
322,
648,
4967,
18005,
31,
14816,
13,
785,
8... | 2.979798 | 198 |
import hashlib
import hmac
from time import time
from typing import Optional, Union
| [
11748,
12234,
8019,
198,
11748,
289,
20285,
198,
6738,
640,
1330,
640,
198,
6738,
19720,
1330,
32233,
11,
4479,
628,
198
] | 4.095238 | 21 |
"""Image parser module.
"""
import os
import base64
def parse_image(image) -> str:
"""Check whether the image is a string or a file path or a file-like object.
:param image:
A base64 string or a file path or a file-like object representing an image.
:return:
Image as a base64 string.
"... | [
37811,
5159,
30751,
8265,
13,
198,
37811,
198,
11748,
28686,
198,
11748,
2779,
2414,
628,
198,
4299,
21136,
62,
9060,
7,
9060,
8,
4613,
965,
25,
198,
220,
220,
220,
37227,
9787,
1771,
262,
2939,
318,
257,
4731,
393,
257,
2393,
3108,
... | 2.614754 | 244 |
# Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
# -------------------------------------------------------------------------------
#
# This file is ... | [
2,
15069,
357,
66,
8,
2177,
13851,
19009,
3337,
357,
34,
15922,
8,
379,
262,
26986,
270,
265,
5231,
261,
6086,
390,
198,
2,
15142,
357,
52,
6242,
737,
198,
2,
198,
2,
770,
670,
318,
11971,
739,
262,
2846,
286,
262,
17168,
5964,
... | 3.606965 | 201 |
import argparse
import json
from os.path import basename, join, split, splitext
import sys
from w4_tiled_converter import converters
# Convert a tiled tmx tilemap to source files
if __name__ == "__main__":
main()
| [
11748,
1822,
29572,
198,
11748,
33918,
198,
6738,
28686,
13,
6978,
1330,
1615,
12453,
11,
4654,
11,
6626,
11,
4328,
578,
742,
198,
11748,
25064,
198,
198,
6738,
266,
19,
62,
83,
3902,
62,
1102,
332,
353,
1330,
6718,
1010,
198,
198,
... | 2.986667 | 75 |
# Generated by Django 2.1.1 on 2018-10-05 22:33
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
16,
319,
2864,
12,
940,
12,
2713,
2534,
25,
2091,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from flask import Blueprint
db_manage_bp = Blueprint('db_manage_cmd', __name__, cli_group=None)
from book_library_app.commands import db_manage_commands | [
6738,
42903,
1330,
39932,
198,
198,
9945,
62,
805,
496,
62,
46583,
796,
39932,
10786,
9945,
62,
805,
496,
62,
28758,
3256,
11593,
3672,
834,
11,
537,
72,
62,
8094,
28,
14202,
8,
198,
198,
6738,
1492,
62,
32016,
62,
1324,
13,
9503,
... | 2.961538 | 52 |
#importing the library
#nn requires matrix2d.py and the math module and random module for dependencies
import nn
import random
#create the neural network to solve the XOR problem
#takes an array of arrays for argument
#the 2, 4 and 1 represent two nodes in the input and 4 nodes in the hidden layer and 1 node in the ou... | [
2,
11748,
278,
262,
5888,
198,
2,
20471,
4433,
17593,
17,
67,
13,
9078,
290,
262,
10688,
8265,
290,
4738,
8265,
329,
20086,
198,
11748,
299,
77,
198,
11748,
4738,
198,
198,
2,
17953,
262,
17019,
3127,
284,
8494,
262,
1395,
1581,
191... | 3.404396 | 455 |
from django.db import models
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import status
from guilds.models import Guild
from dmessages.models import Message
from users.models import User
from channels.models import Channel
from .utils import create_error_response
from .utils import create_... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
9515,
13921,
3673,
3109,
396,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
198,
6738,
19806,
82,
13,
27530,
1330,
16446,
198,
6738,
288,... | 4.066667 | 90 |
from urllib.parse import urlencode
from urllib.request import Request, urlopen
import json
import argparse
import configparser
main()
| [
6738,
2956,
297,
571,
13,
29572,
1330,
2956,
11925,
8189,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19390,
11,
19016,
9654,
198,
11748,
33918,
198,
11748,
1822,
29572,
198,
11748,
4566,
48610,
198,
198,
12417,
3419,
198
] | 3.552632 | 38 |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2015, MuChu Hsu
Contributed by Muchu Hsu (muchu1983@gmail.com)
This file is part of BSD license
<https://opensource.org/licenses/BSD-3-Clause>
"""
import json
from flask import Flask
from flask import request
from flask import render_template
from flask import jsonify
from sto... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
15269,
357,
34,
8,
1853,
11,
8252,
1925,
84,
367,
2385,
198,
4264,
6169,
416,
13111,
84,
367,
2385,
357,
29482,
84,
29279,
31,
14816,
13,
785,
8,
198,
12... | 1.861357 | 678 |
# coding: utf-8
"""
Xero Accounting API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
Contact: api@xero.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
from xero_python.models import BaseModel
... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
1395,
3529,
40964,
7824,
628,
220,
220,
220,
1400,
6764,
2810,
357,
27568,
416,
4946,
15042,
35986,
3740,
1378,
12567,
13,
785,
14,
9654,
499,
270,
10141,
14,
9654... | 2.37602 | 1,226 |
from scipy import stats
import numpy as np
############################
# CALCULATING CORRELATIONS #
############################
array_1 = np.array([1,2,3,4,5,6]) # Create a numpy array from a list
array_2 = array_1 # Create another array with the same values
print(stats.pearsonr(array_1, array_2)) # Calculate t... | [
6738,
629,
541,
88,
1330,
9756,
198,
11748,
299,
32152,
355,
45941,
198,
198,
14468,
7804,
4242,
198,
2,
33290,
34,
6239,
33881,
23929,
16448,
18421,
1303,
198,
14468,
7804,
4242,
198,
198,
18747,
62,
16,
796,
45941,
13,
18747,
26933,
... | 3.513253 | 415 |
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtSql import *
import DarunGrimDatabase
import DiffEngine
from Graphs import *
import FlowGrapher
import FileStoreBrowser
import FileStoreDatabase
import DarunGrimEngine
import pprint
from multiprocessing import Process
from multiprocessing import Que... | [
6738,
9485,
24819,
13,
48,
83,
14055,
1330,
1635,
198,
6738,
9485,
24819,
13,
48,
83,
8205,
72,
1330,
1635,
198,
6738,
9485,
24819,
13,
48,
83,
50,
13976,
1330,
1635,
198,
198,
11748,
7491,
403,
38,
3036,
38105,
198,
11748,
10631,
1... | 2.718033 | 305 |
import asyncio
import logging
from Esipraisal.Esipraisal import Esipraisal
ep_log = logging.getLogger("Esipraisal")
ep_log.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
ep_lo... | [
11748,
30351,
952,
198,
11748,
18931,
198,
6738,
8678,
541,
430,
28456,
13,
23041,
541,
430,
28456,
1330,
8678,
541,
430,
28456,
198,
198,
538,
62,
6404,
796,
18931,
13,
1136,
11187,
1362,
7203,
23041,
541,
430,
28456,
4943,
198,
538,
... | 2.556054 | 223 |
#encoding:utf-8
subreddit = 'goodanimemes'
t_channel = '@r_goodanimemes'
| [
2,
12685,
7656,
25,
40477,
12,
23,
198,
198,
7266,
10748,
796,
705,
11274,
11227,
368,
274,
6,
198,
83,
62,
17620,
796,
705,
31,
81,
62,
11274,
11227,
368,
274,
6,
628
] | 2.272727 | 33 |
import numpy as np
import matplotlib.pyplot as plt
plt.rc('font', family='serif')
X1 , X2 = np.meshgrid(np.linspace(-2,2,500),np.linspace(-2,2,500))
F1 = X1**2 + X2**2
F2 = (X1-1)**2+X2**2
G = X1**2 - X1 + 3/16
G1 = 2 * (X1[0] - 0.1) * (X1[0] - 0.9)
G2 = 20 * (X1[0] - 0.4) * (X1[0] - 0.6)
levels = [0.02, 0.1 , 0... | [
11748,
299,
32152,
355,
45941,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
489,
83,
13,
6015,
10786,
10331,
3256,
1641,
11639,
2655,
361,
11537,
628,
198,
55,
16,
837,
1395,
17,
796,
45941,
13,
76,
5069,
... | 1.835121 | 746 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TransactionTestCase
from django.utils.translation import ugettext_lazy as _
from test_addon.models import Complex, Simple, Unconventional
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9288,
1330,
45389,
14402,
20448,
198,
6738,
42625,
14208,
13,
26791,
13,... | 3.285714 | 70 |
from core.model import ModelWrapper
from flask_restplus import fields, abort
from werkzeug.datastructures import FileStorage
from maxfw.core import MAX_API, PredictAPI
input_parser = MAX_API.parser()
input_parser.add_argument('image', type=FileStorage, location='files', required=True,
help='A... | [
6738,
4755,
13,
19849,
1330,
9104,
36918,
2848,
198,
6738,
42903,
62,
2118,
9541,
1330,
7032,
11,
15614,
198,
6738,
266,
9587,
2736,
1018,
13,
19608,
459,
1356,
942,
1330,
9220,
31425,
198,
6738,
3509,
44482,
13,
7295,
1330,
25882,
62,
... | 3.258197 | 244 |
# Add the upper directory (where the nodebox module is) to the search path.
import os, sys; sys.path.insert(0, os.path.join("..",".."))
from nodebox.graphics import *
img = Image("creature.png")
# The image.quad property describes the four-sided polygon
# on which an image texture is "mounted".
# This is not necess... | [
2,
3060,
262,
6727,
8619,
357,
3003,
262,
10139,
3524,
8265,
318,
8,
284,
262,
2989,
3108,
13,
198,
11748,
28686,
11,
25064,
26,
25064,
13,
6978,
13,
28463,
7,
15,
11,
28686,
13,
6978,
13,
22179,
7203,
492,
2430,
492,
48774,
198,
... | 3.016304 | 184 |
#############################################################################
#
# Copyright (c) 2008 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFT... | [
29113,
29113,
7804,
4242,
2,
198,
2,
198,
2,
15069,
357,
66,
8,
3648,
1168,
3008,
5693,
290,
25767,
669,
13,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
770,
3788,
318,
2426,
284,
262,
8617,
286,
262,
1168,
3008,
5094,
13789,
... | 3.824281 | 313 |
"""
configure jax at startup
"""
from jax.config import config
| [
37811,
198,
11250,
495,
474,
897,
379,
13693,
198,
37811,
198,
198,
6738,
474,
897,
13,
11250,
1330,
4566,
628,
198
] | 3.142857 | 21 |
from enum import Enum, unique
Month = Enum('Month', ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'))
for name, member in Month.__members__.items():
print(name, '=>', member, ',', member.value)
# Jan => Month.Jan , 1
# Feb => Month.Feb , 2
# Mar => Month.Mar , 3
# Apr => Month.A... | [
198,
6738,
33829,
1330,
2039,
388,
11,
3748,
198,
198,
31948,
796,
2039,
388,
10786,
31948,
3256,
19203,
12128,
3256,
705,
15146,
3256,
705,
7676,
3256,
705,
13680,
3256,
705,
6747,
3256,
705,
22396,
3256,
705,
16980,
3256,
705,
12512,
... | 2.483146 | 356 |
import os
import cv2
| [
11748,
28686,
198,
11748,
269,
85,
17,
628,
198
] | 2.555556 | 9 |
# (C) Copyright 2010-2020 Enthought, Inc., Austin, TX
# All rights reserved.
from envisage.core_plugin import CorePlugin
from envisage.ui.tasks.tasks_plugin import TasksPlugin
from force_wfmanager.tests.dummy_classes.dummy_data_view import (
DummyExtensionPluginWithDataView
)
from force_wfmanager.tests.dummy_cl... | [
2,
220,
357,
34,
8,
15069,
3050,
12,
42334,
2039,
28895,
11,
3457,
1539,
9533,
11,
15326,
198,
2,
220,
1439,
2489,
10395,
13,
198,
198,
6738,
45633,
496,
13,
7295,
62,
33803,
1330,
7231,
37233,
198,
6738,
45633,
496,
13,
9019,
13,
... | 3.044944 | 178 |
from unittest import TestCase
from ...services.remote import get_broker_address, send_internal_signal
from pika import BlockingConnection, ConnectionParameters
from simplejson import loads
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
2644,
30416,
13,
47960,
1330,
651,
62,
7957,
6122,
62,
21975,
11,
3758,
62,
32538,
62,
12683,
282,
198,
6738,
279,
9232,
1330,
1086,
8629,
32048,
11,
26923,
48944,
198,
6738,
2829,
17... | 4.152174 | 46 |
from __future__ import division, print_function, unicode_literals
from liberapay.testing import EUR, USD, Harness
| [
6738,
11593,
37443,
834,
1330,
7297,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
3655,
499,
323,
13,
33407,
1330,
27526,
11,
11403,
11,
2113,
1108,
628
] | 3.625 | 32 |
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy import ForeignKey
from sqlalchemy.sql import select
from sqlalchemy.orm import relationship
from sqlalchemy.dialects.postgresql import JSON, TEXT
db = SQLAlchemy()
#Column('user_id', Integer, ForeignKey("user.user_id"), nullable=False),
| [
6738,
42903,
13,
2302,
13,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
44161,
282,
26599,
1330,
8708,
9218,
198,
6738,
44161,
282,
26599,
13,
25410,
1330,
2922,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
2776,
198,
6738,
4... | 3.359551 | 89 |
# lista de dicionario dado
listDict = [
{1 : 1, 2 : "oi", "nome" : "obrigado"},
{"Bolo" : "Cenoura", "Camarão" : "Verde", "nome" : "Sagrado"},
{1 : 10, "nome" : "oi", "caracol" : "obrigado"},
{"nome":"obrigado"}
]
# a chave que será procurada
nome = "nome"
# inicializando a lista vazia
lista = []
# ... | [
2,
1351,
64,
390,
288,
47430,
4982,
288,
4533,
198,
4868,
35,
713,
796,
685,
198,
220,
220,
220,
1391,
16,
1058,
352,
11,
362,
1058,
366,
23013,
1600,
366,
77,
462,
1,
1058,
366,
672,
4359,
4533,
25719,
198,
220,
220,
220,
19779,
... | 2.166667 | 294 |
from rest_framework import status, exceptions
from rest_framework.generics import RetrieveUpdateAPIView
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from django.conf import settings
from .models import User
from i... | [
6738,
1334,
62,
30604,
1330,
3722,
11,
13269,
198,
6738,
1334,
62,
30604,
13,
8612,
873,
1330,
4990,
30227,
10260,
2969,
3824,
769,
198,
6738,
1334,
62,
30604,
13,
525,
8481,
1330,
22507,
7149,
11,
1148,
47649,
3474,
198,
6738,
1334,
... | 3.086486 | 555 |
"""
Calculate additional parameters or recalculate parameters.
"""
from visual_phenomics_py.parameters import *
from visual_phenomics_py.parameters_additional import *
def calculate(df=None, param='', *, fm='fm', f0='f0', fmp='fmp', f0p='f0p', fs='fs', fmpp='fmpp', f0pp='f0pp', fmf0=4.88, alias=None):
"""Calcula... | [
37811,
198,
9771,
3129,
378,
3224,
10007,
393,
42653,
3129,
378,
10007,
13,
198,
37811,
198,
198,
6738,
5874,
62,
31024,
31994,
62,
9078,
13,
17143,
7307,
1330,
1635,
198,
6738,
5874,
62,
31024,
31994,
62,
9078,
13,
17143,
7307,
62,
2... | 1.914304 | 6,348 |
from peewee import *
db = SqliteDatabase(':memory:')
db.create_tables([Node])
tree = ('root', (
('n1', (
('c11', ()),
('c12', ()))),
('n2', (
('c21', ()),
('c22', (
('g221', ()),
('g222', ()))),
('c23', ()),
('c24', (
('g241... | [
6738,
613,
413,
1453,
1330,
1635,
628,
198,
9945,
796,
311,
13976,
578,
38105,
7,
10354,
31673,
25,
11537,
198,
198,
9945,
13,
17953,
62,
83,
2977,
26933,
19667,
12962,
198,
198,
21048,
796,
19203,
15763,
3256,
357,
198,
220,
220,
220... | 2.267068 | 498 |
# -*- coding: utf-8
import numpy as np
import wx
from ihna.kozhukhov.imageanalysis import ImagingMap
from ihna.kozhukhov.imageanalysis.mapprocessing import spatial_filter
from ihna.kozhukhov.imageanalysis.gui.complexmapviewerdlg import ComplexMapViewerDlg
from .datatodataprocessor import DataToDataProcessor
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
266,
87,
198,
6738,
1312,
71,
2616,
13,
7204,
23548,
2724,
28026,
13,
9060,
20930,
1330,
48656,
13912,
198,
6738,
1312,
71,
2616,
13,
... | 2.906542 | 107 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 3.75 | 8 |
# PyAlgoTrade
#
# Copyright 2011 Gabriel Martin Becedillas Ruiz
#
# 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 applica... | [
2,
9485,
2348,
2188,
35965,
198,
2,
198,
2,
15069,
2813,
17371,
5780,
15780,
276,
25314,
11667,
528,
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,
... | 3.004373 | 686 |
from typing import Any
| [
6738,
19720,
1330,
4377,
628,
628,
198
] | 3.857143 | 7 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | [
2,
220,
15069,
2177,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
345,
743,
407,
779,
428,
2393,
2... | 2.411222 | 1,301 |