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
from __future__ import absolute_import
from flask import json
from six import BytesIO
from swagger_server.models.result import Result # noqa: E501
from swagger_server.models.result2 import Result2 # noqa: E501
from swagger_server.test import BaseTestCase
class TestAnalysisController(BaseTestCase):... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
42903,
1330,
33918,
198,
6738,
2237,
1330,
2750,
4879,
9399,
198,
198,
6738,
1509,
7928,
62,
15388,
13,
27530,
13,
20274,
1330,
... | 2.140434 | 3,596 |
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from Moodipy.UserSummary import Person
from screeninfo import get_monitors
| [
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
1635,
201,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72,
1330,
1635,
201,
198,
6738,
25723,
541,
88,
13,
12982,
22093,
1330,
7755,
201,
198,
6738,
3159,
10951,
1330,
... | 2.328125 | 64 |
G = nx.DiGraph()
G.add_nodes_from(['A', 'B', 'C', 'D', 'E'])
G.add_edge('A', 'B')
G.add_edge('B', 'B')
G.add_edges_from([('A', 'E'),('A', 'D'),('B', 'C'),('C', 'E'),('D', 'C')])
| [
38,
796,
299,
87,
13,
18683,
37065,
3419,
198,
38,
13,
2860,
62,
77,
4147,
62,
6738,
7,
17816,
32,
3256,
705,
33,
3256,
705,
34,
3256,
705,
35,
3256,
705,
36,
6,
12962,
198,
38,
13,
2860,
62,
14907,
10786,
32,
3256,
705,
33,
1... | 1.78 | 100 |
from pymutual.models.profile import Profile | [
6738,
279,
4948,
315,
723,
13,
27530,
13,
13317,
1330,
13118
] | 3.909091 | 11 |
import os
import json
import pandas as pd
import pickle5 as pkl
from pathlib import Path
from collections import defaultdict
curr_dir = Path(os.getcwd())
parent_dir = curr_dir.parent
source_dir = parent_dir.parent
result_dir = os.path.join(source_dir, 'pkl_results')
output_dir = os.path.join(parent_dir, 'dashboard', '... | [
11748,
28686,
198,
11748,
33918,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2298,
293,
20,
355,
279,
41582,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
22019,
81,
62,
15908,
796,
10644,
7,
... | 2.237687 | 934 |
#!/usr/bin/python3
# Incubator control software
#
# Written by Keith M. Hughes
#
# This code is for driving an incubator. It assumes a DHT22 temperature humidity
# sensor. It has a GUI control interface for setting temperatures and
# seeing the current temperature.
#
# It makes use of Python threads.
# This code use... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
2,
3457,
549,
1352,
1630,
3788,
198,
2,
198,
2,
22503,
416,
14926,
337,
13,
19712,
198,
2,
198,
2,
770,
2438,
318,
329,
5059,
281,
25543,
1352,
13,
632,
18533,
257,
360,
6535,
... | 2.935211 | 355 |
# coding=utf-8
# Copyright (c) 2021, EleutherAI contributors
# This file is based on code by the authors denoted below and has been modified from its original version.
#
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
357,
66,
8,
33448,
11,
15987,
12866,
20185,
20420,
198,
2,
770,
2393,
318,
1912,
319,
2438,
416,
262,
7035,
2853,
5191,
2174,
290,
468,
587,
9518,
422,
663,
2656,
2196,
13,
198,
2,
198,
... | 2.319644 | 14,488 |
import tensorflow as tf
import numpy as np
import model as M
blknum = 0
with tf.variable_scope('MainModel'):
imgholder,featurelayer = res_18()
saver = tf.train.Saver()
sess = tf.Session()
M.loadSess('./model/',sess=sess)
saver.save(sess,'./model.ckpt') | [
11748,
11192,
273,
11125,
355,
48700,
220,
198,
11748,
299,
32152,
355,
45941,
220,
198,
11748,
2746,
355,
337,
220,
198,
198,
2436,
15418,
388,
796,
657,
198,
198,
4480,
48700,
13,
45286,
62,
29982,
10786,
13383,
17633,
6,
2599,
198,
... | 2.443396 | 106 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# measure spread in activations, dropout, and identity
import glob
import json
import numpy as np
np.set_printoptions(linewidth=200)
d = {}
for filename in glob.glob("data/*npy"):
d[filename] = np.load(filename)
print('loaded', filename)
activation_list = jso... | [
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,
2,
3953,
4104,
287,
1753,
602,
11,
4268,
448,
11,
290,
5369,
198,
198,
11748,
15095,
198,
11748,
33918,
198,... | 2.552343 | 2,283 |
#!/usr/bin/env python
"""
m2g.utils.qa_utils
~~~~~~~~~~~~~~~~~~~~
Contains small-scale qa utilities
"""
import numpy as np
def get_min_max(data, minthr=2, maxthr=95):
"""
A function to find min,max values at designated percentile thresholds
Parameters
-----------
data: np array
3-d regmri... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
76,
17,
70,
13,
26791,
13,
20402,
62,
26791,
198,
27156,
8728,
198,
4264,
1299,
1402,
12,
9888,
10662,
64,
20081,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
... | 2.428571 | 994 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.forms import fields, widgets
from django.core.exceptions import ValidationError
from django.template import engines
from django.template.loader import select_template
from django.utils.translation import ugettext_lazy ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
23914,
1330,
7032,
11,
40803,
198,
6738,... | 3.433036 | 224 |
import sys
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from src.app import index
| [
11748,
25064,
198,
6738,
28686,
1330,
3108,
198,
17597,
13,
6978,
13,
33295,
7,
6978,
13,
15908,
3672,
7,
6978,
13,
15908,
3672,
7,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
35514,
198,
6738,
12351,
13,
1324,
1330,
6376,
198
] | 2.97619 | 42 |
'''
transform file format
.npy:
numpy array, load with np.load()
.ang:
EBSD file format, referene: https://www.material.ntnu.no/ebsd/EBSD/OIM%20DC%207.2%20Manual.pdf, page 240.
# The fields of each line in the body of the file are as follows:
# j1 F j2 x y IQ CI Phase ID Detector Intensity Fit
# w... | [
7061,
6,
198,
35636,
2393,
5794,
198,
13,
77,
9078,
25,
198,
220,
220,
220,
220,
299,
32152,
7177,
11,
3440,
351,
45941,
13,
2220,
3419,
198,
13,
648,
25,
220,
198,
220,
220,
220,
412,
21800,
2393,
5794,
11,
6773,
710,
25,
3740,
... | 2.033949 | 4,006 |
#!/usr/bin/env python3
from __future__ import print_function
from argparse import ArgumentParser
from copy import deepcopy
from datetime import datetime
import csv
import heapq
import json
import math
import networkx as nx
import ntpath # https://stackoverflow.com/a/8384788
import operator
import os
import scipy.st... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
6738,
4866,
1330,
2769,
30073,
198,
6738,
4818,
8079,
1330,
4818,
8079,
628,
198,... | 1.991267 | 4,008 |
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
The ``Colorbar`` plugin shows a colorbar indicating the colormap applied
to the image and showing the example values along the range.
**Plugin Type: Global**
``Colorbar`` is a global plugin. Only one insta... | [
2,
770,
318,
1280,
12,
10459,
3788,
11971,
739,
257,
347,
10305,
5964,
13,
198,
2,
4222,
766,
262,
2393,
38559,
24290,
13,
14116,
329,
3307,
13,
198,
37811,
198,
464,
7559,
10258,
5657,
15506,
13877,
2523,
257,
3124,
5657,
12739,
262,... | 3.533333 | 300 |
# https://udemy.com/recommender-systems
# https://deeplearningcourses.com/recommender-systems
from __future__ import print_function, division
from builtins import range, input
# Note: you may need to update your version of future
# sudo pip install -U future
import pickle
import numpy as np
import pandas as pd
import ... | [
2,
3740,
1378,
463,
3065,
13,
785,
14,
47335,
2194,
12,
10057,
82,
198,
2,
3740,
1378,
22089,
40684,
66,
39975,
13,
785,
14,
47335,
2194,
12,
10057,
82,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
7297,
198,
6738,
3170,
... | 2.528446 | 914 |
import click
from pathlib import Path
from .utils import SnapshotManager, SnapshotType
from dataPipelines.gc_ingest.config import Config
from dataPipelines.gc_ingest.common_cli_options import pass_bucket_name_option
import functools
import datetime as dt
import json
@click.group(name="snapshot")
@pass_core_snapshot... | [
11748,
3904,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
764,
26791,
1330,
16026,
9442,
13511,
11,
16026,
9442,
6030,
198,
6738,
1366,
47,
541,
20655,
13,
36484,
62,
278,
395,
13,
11250,
1330,
17056,
198,
6738,
1366,
47,
541,
20655,
... | 2.537815 | 1,547 |
from time_check import time_check
@time_check
if __name__ == '__main__':
arr1 = [1, 2, 5, 7, 2, 1]
print(selection_sort(arr1))
| [
6738,
640,
62,
9122,
1330,
640,
62,
9122,
628,
198,
31,
2435,
62,
9122,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
5240,
16,
796,
685,
16,
11,
362,
11,
642,
11,
767,
11,
362,
11,
352,... | 2.316667 | 60 |
import yaml
import sys
from util.singleton import Singleton
from util.date import parse_timespan_to_seconds
import os
| [
11748,
331,
43695,
198,
11748,
25064,
198,
6738,
7736,
13,
12215,
10565,
1330,
5573,
10565,
198,
6738,
7736,
13,
4475,
1330,
21136,
62,
22355,
6839,
62,
1462,
62,
43012,
198,
11748,
28686,
628,
628
] | 3.558824 | 34 |
# Dan Blankenberg
import sys
from galaxy_utils.sequence.fasta import (
fastaNamedReader,
fastaReader,
)
from galaxy_utils.sequence.fastq import (
fastqCombiner,
fastqFakeFastaScoreReader,
fastqWriter,
)
if __name__ == "__main__":
main()
| [
2,
6035,
31990,
23140,
628,
198,
11748,
25064,
198,
198,
6738,
16161,
62,
26791,
13,
43167,
13,
7217,
64,
1330,
357,
198,
220,
220,
220,
3049,
64,
45,
2434,
33634,
11,
198,
220,
220,
220,
3049,
64,
33634,
11,
198,
8,
198,
6738,
16... | 2.567308 | 104 |
"""empty message
Revision ID: a6f210d1c6
Revises: 1d62d90de0d
Create Date: 2015-11-17 00:21:55.100054
"""
# revision identifiers, used by Alembic.
revision = 'a6f210d1c6'
down_revision = '1d62d90de0d'
from alembic import op
import sqlalchemy as sa
| [
37811,
28920,
3275,
198,
198,
18009,
1166,
4522,
25,
257,
21,
69,
21536,
67,
16,
66,
21,
198,
18009,
2696,
25,
352,
67,
5237,
67,
3829,
2934,
15,
67,
198,
16447,
7536,
25,
1853,
12,
1157,
12,
1558,
3571,
25,
2481,
25,
2816,
13,
... | 2.351852 | 108 |
# Copyright 2019 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 applica... | [
2,
15069,
13130,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,... | 2.577904 | 1,765 |
# coding=utf-8
# Copyright 2021 The Tensor2Tensor Authors.
#
# 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... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
33448,
383,
309,
22854,
17,
51,
22854,
46665,
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,
... | 2.867445 | 1,456 |
import datetime
from direct.showbase.DirectObject import DirectObject
from panda3d.core import LVector3f, LVector4f
from Engine.Utils.utils import read_xml_args
class Step:
"""
Class representing one step in the scenario.
"""
step_counter = 0
def __init__(self, gameEngine, end_conditions=None, ... | [
11748,
4818,
8079,
198,
198,
6738,
1277,
13,
12860,
8692,
13,
13470,
10267,
1330,
4128,
10267,
198,
6738,
279,
5282,
18,
67,
13,
7295,
1330,
24981,
9250,
18,
69,
11,
24981,
9250,
19,
69,
198,
198,
6738,
7117,
13,
18274,
4487,
13,
26... | 1.947529 | 7,890 |
# Take these unit tests compile them together in
# a function to check the function find_force
assert find_force(50, 3) == 150, 'Input arguments giving incorrect output'
assert find_force(100, -2) == -200, 'Input arguments giving incorrect output'
assert find_force(5, 20) == 100, 'Input arguments giving incorrect ou... | [
198,
2,
7214,
777,
4326,
5254,
17632,
606,
1978,
287,
220,
198,
2,
257,
2163,
284,
2198,
262,
2163,
1064,
62,
3174,
198,
198,
30493,
1064,
62,
3174,
7,
1120,
11,
513,
8,
6624,
6640,
11,
705,
20560,
7159,
3501,
11491,
5072,
6,
198,... | 3.670213 | 94 |
from telegrask import InlineQuery
from telegram.ext import CallbackContext
from telegram import Update
from .config import SOURCE_URL
from .functions import get_answers
from .urlbutton import URLButton
from . import bot
@bot.inline_query
@bot.custom_help_command
| [
6738,
573,
1455,
81,
2093,
1330,
554,
1370,
20746,
198,
6738,
573,
30536,
13,
2302,
1330,
4889,
1891,
21947,
198,
6738,
573,
30536,
1330,
10133,
198,
6738,
764,
11250,
1330,
311,
31033,
62,
21886,
198,
6738,
764,
12543,
2733,
1330,
651,... | 3.467532 | 77 |
import tensorflow as tf
from grace_dl.tensorflow import Compressor
class AdaqCompressor(Compressor):
"""
(2017). Communication quantization for data-parallel training of deep neural networks.
https://doi.org/10.1109/MLHPC.2016.4
"""
| [
11748,
11192,
273,
11125,
355,
48700,
201,
198,
201,
198,
6738,
11542,
62,
25404,
13,
83,
22854,
11125,
1330,
3082,
44292,
201,
198,
201,
198,
201,
198,
4871,
1215,
30188,
7293,
44292,
7,
7293,
44292,
2599,
201,
198,
220,
220,
220,
37... | 2.757895 | 95 |
#!/usr/bin/env python3
# Copyright 2019 Canonical Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
15069,
13130,
19507,
605,
12052,
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,
42... | 3.025882 | 425 |
#!/usr/bin/env python3
# METADATA OF THIS TAL_SERVICE:
args_list = [
('n',int),
('sorting_criterion',str),
('more_or_less_hint_if_wrong',bool),
]
from sys import stderr, exit
from TALinputs import TALinput
from multilanguage import Env, Lang, TALcolors
from piastrelle_lib import Par
import random
ENV =... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
31243,
2885,
13563,
3963,
12680,
309,
1847,
62,
35009,
27389,
25,
198,
22046,
62,
4868,
796,
685,
198,
220,
220,
220,
19203,
77,
3256,
600,
828,
198,
220,
220,
220,
19203... | 2.224427 | 655 |
#!/usr/local/bin/python3
import sys
FIRMWARE_SIZE = 4096
FILENAME = "fake_firmware.bin"
print("Writing generated firmware file:", FILENAME)
print("The size will be:", FIRMWARE_SIZE)
with open(FILENAME, "wb") as fh:
for i in range(FIRMWARE_SIZE >> 1):
fh.write(i.to_bytes(2, "little"))
| [
2,
48443,
14629,
14,
12001,
14,
8800,
14,
29412,
18,
198,
198,
11748,
25064,
198,
198,
39776,
14326,
12203,
62,
33489,
796,
42479,
198,
46700,
1677,
10067,
796,
366,
30706,
62,
69,
2533,
1574,
13,
8800,
1,
198,
198,
4798,
7203,
33874,... | 2.390625 | 128 |
# Importing various modules
import threading
import os
import abc
import time
import yfinance as yf
from alpaca_trade_api import REST
import pandas as pd
import numpy as np
import tensorflow as tf
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
from ker... | [
2,
17267,
278,
2972,
13103,
201,
198,
11748,
4704,
278,
201,
198,
11748,
28686,
201,
198,
11748,
450,
66,
201,
198,
11748,
640,
201,
198,
11748,
331,
69,
14149,
355,
331,
69,
201,
198,
6738,
435,
79,
22260,
62,
25351,
62,
15042,
133... | 3.189655 | 348 |
import os
import numpy as np
import torch
import torch.nn as nn
import time
from numpy.linalg import norm
import copy
import math
from numpy.linalg import cholesky
import argparse
def g(S):
"""
Exchange options
"""
zeros = torch.zeros(S.size()[0], 1, device=device)
dim = S.size()[1]
... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
640,
198,
6738,
299,
32152,
13,
75,
1292,
70,
1330,
2593,
198,
11748,
4866,
198,
11748,
10688,
198,
6738,
299,
... | 2.355811 | 1,394 |
"""Common methods used across tests for Netatmo."""
import json
from tests.common import load_fixture
CLIENT_ID = "1234"
CLIENT_SECRET = "5678"
ALL_SCOPES = [
"read_station",
"read_camera",
"access_camera",
"write_camera",
"read_presence",
"access_presence",
"write_presence",
"read_hom... | [
37811,
17227,
5050,
973,
1973,
5254,
329,
3433,
265,
5908,
526,
15931,
198,
11748,
33918,
198,
198,
6738,
5254,
13,
11321,
1330,
3440,
62,
69,
9602,
198,
198,
5097,
28495,
62,
2389,
796,
366,
1065,
2682,
1,
198,
5097,
28495,
62,
23683... | 2.296386 | 415 |
# Copyright (c) 2018, NVIDIA CORPORATION. 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 appli... | [
2,
15069,
357,
66,
8,
2864,
11,
15127,
23929,
44680,
6234,
13,
220,
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,
2393,... | 3.540441 | 272 |
import unittest
from oeqa.oetest import oeRuntimeTest, skipModule
from oeqa.utils.decorators import *
class SanityTestFlatpakSession(oeRuntimeTest):
'''flatpak session sanity tests'''
def test_session_files(self):
'''check if flatpak session binaries and service files exist'''
files = [
... | [
11748,
555,
715,
395,
198,
6738,
267,
68,
20402,
13,
78,
316,
395,
1330,
267,
68,
41006,
14402,
11,
14267,
26796,
198,
6738,
267,
68,
20402,
13,
26791,
13,
12501,
273,
2024,
1330,
1635,
198,
198,
4871,
2986,
414,
14402,
7414,
265,
4... | 2.222772 | 404 |
from django.urls import path
from api_notification.views import (
NbsNotification,
ManageNotification,
GetAllNotification,
)
urlpatterns = [
path('getnbsnotifications', NbsNotification.as_view(), name="nbs_notif"),
path('postmanagenotification', ManageNotification.as_view(), name="post_notif_read")... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
40391,
62,
1662,
2649,
13,
33571,
1330,
357,
198,
220,
220,
220,
399,
1443,
3673,
2649,
11,
198,
220,
220,
220,
1869,
496,
3673,
2649,
11,
198,
220,
220,
220,
3497,
3237,
3673... | 2.769737 | 152 |
import serial
apikey = 'AIzaSyAvTQCGl03_PMRmJM6lFVWK7OI_GrdoYn8'
API_KEY = 'AIzaSyAvTQCGl03_PMRmJM6lFVWK7OI_GrdoYn8'
from googleplaces import GooglePlaces, types, lang
import requests
import json
from math import sin, cos, sqrt, atan2, radians
google_places = GooglePlaces(API_KEY)
ser = serial.Serial('/dev/ttyACM0... | [
11748,
11389,
198,
499,
522,
88,
796,
705,
20185,
4496,
13940,
7355,
51,
48,
34,
9861,
3070,
62,
5868,
49,
76,
50229,
21,
75,
37,
30133,
42,
22,
46,
40,
62,
38,
4372,
78,
56,
77,
23,
6,
198,
17614,
62,
20373,
796,
705,
20185,
... | 2.003984 | 1,255 |
###
# SERIF Windows Scheduled Build Wraper
#
# Runs the scheduled build and emails the results.
###
import email_wrapper
import runpy
def run_scheduled_build():
"""
"""
# Execute the build which is just flat code, no method definitions
build_globals = runpy.run_module("win_scheduled_build")
# Re... | [
21017,
198,
2,
18871,
5064,
3964,
27774,
6309,
10934,
27323,
525,
198,
2,
198,
2,
44743,
262,
7530,
1382,
290,
7237,
262,
2482,
13,
198,
21017,
198,
198,
11748,
3053,
62,
48553,
198,
11748,
1057,
9078,
198,
198,
4299,
1057,
62,
1416,
... | 2.793103 | 261 |
#!/usr/bin/env python
from setuptools import setup, find_packages
with open("requirements.txt", "r") as FH:
REQUIREMENTS = FH.readlines()
NAME = 'samplelink-model'
VERSION = '0.0.1'
DESCRIPTION = 'Samplelink Model: A high level datamodel of computer systems ontology entities and associations'
URL = 'https://gith... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
4480,
1280,
7203,
8897,
18883,
13,
14116,
1600,
366,
81,
4943,
355,
376,
39,
25,
198,
220,
220,
220,
4526,
49... | 2.630996 | 542 |
# Databricks notebook source
# MAGIC %md
# MAGIC **Description** This notebook creates the test and train samples used in CCU004-2
# MAGIC
# MAGIC **Project(s)** CCU004-2 - A nationwide deep learning pipeline to predict stroke and COVID-19 death in atrial fibrillation
# MAGIC
# MAGIC **Author(s)** Alex Handy
# MAG... | [
2,
16092,
397,
23706,
20922,
2723,
198,
2,
28263,
2149,
4064,
9132,
198,
2,
28263,
2149,
12429,
11828,
1174,
770,
20922,
8075,
262,
1332,
290,
4512,
8405,
973,
287,
12624,
52,
22914,
12,
17,
198,
2,
28263,
2149,
220,
220,
198,
2,
28... | 2.474409 | 1,524 |
# coding=utf-8
"""Functional tests for the Pulp platform.
According to the documentation:
Pulp can be viewed as consisting of two parts, the platform (which includes
both the server and client applications) and plugins (which provide support
for a particular set of content types).
This package contains t... | [
2,
19617,
28,
40477,
12,
23,
198,
37811,
22203,
282,
5254,
329,
262,
21624,
79,
3859,
13,
198,
198,
4821,
284,
262,
10314,
25,
628,
220,
220,
220,
21624,
79,
460,
307,
9569,
355,
17747,
286,
734,
3354,
11,
262,
3859,
357,
4758,
34... | 4.088235 | 136 |
import os
import sys
import itertools
import random
import operator
import functools
import networkx
BASE = os.path.normpath(os.path.abspath(os.path.join(os.path.dirname(__file__))))
sys.path.append(BASE)
import PyBoolNet.StateTransitionGraphs
import PyBoolNet.Utility
import PyBoolNet.ModelChecking
import PyBoolNet... | [
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
340,
861,
10141,
198,
11748,
4738,
198,
11748,
10088,
198,
11748,
1257,
310,
10141,
198,
11748,
3127,
87,
198,
198,
33,
11159,
796,
28686,
13,
6978,
13,
27237,
6978,
7,
418,
13,
6... | 2.234927 | 10,416 |
from functools import wraps
from time import ctime
@time_fun("Itcast")
@make_bold
@make_italic
@Descriptor
print(tes())
print(tes.__name__)
print(main(3, 5, 7))
| [
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
640,
1330,
269,
2435,
628,
628,
628,
198,
31,
2435,
62,
12543,
7203,
1026,
2701,
4943,
198,
31,
15883,
62,
36575,
198,
31,
15883,
62,
1287,
291,
628,
198,
31,
24564,
1968,
273,
628,
19... | 2.514706 | 68 |
from __future__ import unicode_literals
from .models import transcribe_backends
transcribe_backend = transcribe_backends["us-east-1"]
mock_transcribe = transcribe_backend.decorator
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
764,
27530,
1330,
23589,
4892,
62,
1891,
2412,
198,
198,
7645,
66,
4892,
62,
1891,
437,
796,
23589,
4892,
62,
1891,
2412,
14692,
385,
12,
23316,
12,
16,
8973,... | 3.05 | 60 |
import logging
import logstash
import sys
host = '127.0.0.1'
test_logger = logging.getLogger('python-logstash-logger')
test_logger.setLevel(logging.INFO)
test_logger.addHandler(logstash.HTTPLogstashHandler(host, 1337, ssl=True, verify=True, username="user", password="pw"))
# test_logger.addHandler(logstash.TCPLogstas... | [
11748,
18931,
198,
11748,
2604,
301,
1077,
198,
11748,
25064,
198,
198,
4774,
796,
705,
16799,
13,
15,
13,
15,
13,
16,
6,
198,
198,
9288,
62,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
10786,
29412,
12,
6404,
301,
1077,
12,
6404... | 2.608824 | 340 |
from flask import Flask, request, render_template
import pandas as pd
import joblib
from tensorflow.keras.preprocessing.sequence import pad_sequences
import pickle
from keras.models import load_model
from flask import jsonify
model = 'LSTM'
# Declare a Flask app
app = Flask(__name__)
saved_model = load_model('fake_n... | [
6738,
42903,
1330,
46947,
11,
2581,
11,
8543,
62,
28243,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
1693,
8019,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
3866,
36948,
13,
43167,
1330,
14841,
62,
3107,
3007,
198,
11748,
2... | 2.885417 | 192 |
"""
Implements the Load Curve Supply plot.
"""
from __future__ import division
from __future__ import print_function
import plotly.graph_objs as go
import cea.plots.demand
from cea.plots.variable_naming import NAMING, COLOR
class LoadCurveSupplyPlot(cea.plots.demand.DemandPlotBase):
"""Implement the load-curve-... | [
37811,
198,
3546,
1154,
902,
262,
8778,
46300,
22663,
7110,
13,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
7110,
306,
13,
34960,
62,
672,
8457,
355,
467,
... | 2.212842 | 841 |
# follows semantic versioning
# https://learningd3.com/blog/d3-versioning/
__version__ = '0.1.1'
| [
2,
5679,
37865,
2196,
278,
198,
2,
3740,
1378,
40684,
67,
18,
13,
785,
14,
14036,
14,
67,
18,
12,
9641,
278,
14,
198,
834,
9641,
834,
796,
705,
15,
13,
16,
13,
16,
6,
198
] | 2.694444 | 36 |
from owslib.etree import etree
from owslib.util import Authentication, openURL
from urllib.parse import urlencode, parse_qsl
class WFSCapabilitiesReader(object):
"""Read and parse capabilities document into a lxml.etree infoset
"""
def __init__(self, version="1.0", username=None, password=None, headers=... | [
6738,
12334,
6649,
571,
13,
316,
631,
1330,
2123,
631,
198,
6738,
12334,
6649,
571,
13,
22602,
1330,
48191,
11,
1280,
21886,
198,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
2956,
11925,
8189,
11,
21136,
62,
80,
6649,
628,
198,
4871,
... | 2.324552 | 949 |
import hypertune
import tensorflow as tf
hpt = hypertune.HyperTune()
| [
198,
11748,
32608,
1726,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
71,
457,
796,
32608,
1726,
13,
38197,
51,
1726,
3419,
198
] | 2.958333 | 24 |
# -*- coding: utf-8 -*-
import sys
import os
from cmd import Cmd
from platform import system as osys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
class Manager(object):
""" 控制器基类
衔接命令行框架与分析器
"""
__an = None # 分析器
__rootPath = "" # root路径
__pwd = "" # 当前脚本路径
__outputD... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
25064,
198,
11748,
28686,
198,
6738,
23991,
1330,
327,
9132,
198,
6738,
3859,
1330,
1080,
355,
267,
17597,
198,
198,
47,
56,
17,
796,
25064,
13,
9641,
62,
... | 1.218713 | 3,388 |
import glob
import numpy
import json
import urllib.request
import csv
from hashlib import md5
import os
import requests
import shutil
odir = "data/images"
collection_url = "https://archdataset.dl.itc.u-tokyo.ac.jp/collections/gaikotsu/image/collection.json"
response = urllib.request.urlopen(collection_url)
response... | [
11748,
15095,
198,
11748,
299,
32152,
198,
11748,
33918,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
269,
21370,
198,
6738,
12234,
8019,
1330,
45243,
20,
198,
11748,
28686,
198,
11748,
7007,
198,
11748,
4423,
346,
628,
198,
375,
... | 2.62 | 350 |
# -*- coding: utf-8 -*-
# http://127.0.0.1:8050/
import os
cfgpath = '../config.ini' if os.path.isfile('../config.ini') else 'config.ini'
#%%# Pre-script checks, debug logger #########################################
clock_x = '82%' # default
with open(cfgpath, 'r') as f:
txt = [line.strip(' \n') for line in f.rea... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2638,
1378,
16799,
13,
15,
13,
15,
13,
16,
25,
1795,
1120,
14,
198,
11748,
28686,
198,
37581,
6978,
796,
705,
40720,
11250,
13,
5362,
6,
611,
28686,
13,
6978,
13,... | 2.165826 | 3,172 |
from astropy import units as u
from six import reraise
from six.moves import zip_longest
import sys
import os
import errno
import itertools
_quantity = u.Quantity
def mkdir_p(path):
""" mkdir -p equivalent [used by get_datafile]"""
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
... | [
6738,
6468,
28338,
1330,
4991,
355,
334,
198,
6738,
2237,
1330,
302,
40225,
198,
6738,
2237,
13,
76,
5241,
1330,
19974,
62,
6511,
395,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
11454,
3919,
198,
11748,
340,
861,
10141,
198,
62,
... | 2.413103 | 1,099 |
from setuptools import setup
version = "0.0.2"
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="django-language-autoswitcher",
version=version,
keywords="django-language-autoswitcher",
description="Switch language by wind",
long_description=long_description,
lo... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
9641,
796,
366,
15,
13,
15,
13,
17,
1,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
1... | 2.650746 | 335 |
'''
.. module:: skrf.vi.stages
================================================
Stages (:mod:`skrf.vi.stages`)
================================================
.. autosummary::
:toctree: generated/
ESP300
'''
from time import sleep
import numpy as npy
from visa import GpibInstrument
class ESP300(GpibIn... | [
198,
198,
7061,
6,
198,
198,
492,
8265,
3712,
1341,
41871,
13,
8903,
13,
301,
1095,
198,
10052,
4770,
198,
1273,
1095,
220,
357,
25,
4666,
25,
63,
8135,
41871,
13,
8903,
13,
301,
1095,
63,
8,
198,
10052,
4770,
198,
198,
492,
44619... | 1.963141 | 1,872 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from authenticatorpy.authenticator import Authenticator
| [
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,
555,
715,
395,
198,
198,
6738,
16425,
1352,
9078,
13,
41299,
26407,
1330,
31885,
26407,
628
] | 2.95122 | 41 |
from collections import deque
n = int(input())
m = int(input())
relation = {}
for i in range(m):
a, b = map(int, input().split())
relation.setdefault(a, {})
relation.setdefault(b, {})
relation[a].setdefault(b, {})
relation[b].setdefault(a, {})
ans = set([])
q = deque([(1, 0)])
isVisit = [False for ... | [
6738,
17268,
1330,
390,
4188,
198,
77,
796,
493,
7,
15414,
28955,
198,
76,
796,
493,
7,
15414,
28955,
198,
49501,
796,
23884,
198,
198,
1640,
1312,
287,
2837,
7,
76,
2599,
198,
220,
220,
220,
257,
11,
275,
796,
3975,
7,
600,
11,
... | 2.236559 | 279 |
# Python Program Using The Assert Statement And Catching AssertionError
'''
Function Name : Usage Assert Statement And Catching AssertionError
Function Date : 23 Sep 2020
Function Author : Prasad Dangare
Input : String
Output : String
'''
try:
x = int(input('Enter A N... | [
2,
11361,
6118,
8554,
383,
2195,
861,
21983,
843,
327,
19775,
2195,
861,
295,
12331,
201,
198,
201,
198,
201,
198,
7061,
6,
201,
198,
22203,
6530,
220,
220,
220,
1058,
220,
29566,
2195,
861,
21983,
843,
327,
19775,
2195,
861,
295,
1... | 2.550505 | 198 |
from sklearn import linear_model
from sklearn.neighbors import NearestNeighbors
import pandas as pd
from dowhy.causal_estimator import CausalEstimate
from dowhy.causal_estimators.propensity_score_estimator import PropensityScoreEstimator
class PropensityScoreMatchingEstimator(PropensityScoreEstimator):
""" Estima... | [
6738,
1341,
35720,
1330,
14174,
62,
19849,
198,
6738,
1341,
35720,
13,
710,
394,
32289,
1330,
3169,
12423,
46445,
32289,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
47276,
12114,
13,
6888,
6775,
62,
395,
320,
1352,
1330,
6488,... | 3.885714 | 280 |
from __future__ import annotations
from confluent_kafka.admin import AdminClient, NewTopic
from confluent_kafka import Producer, Consumer, Message, KafkaError, TopicPartition, OFFSET_BEGINNING, OFFSET_END
from concurrent.futures import Future
from typing import List, Tuple, Dict, Callable
from austin_heller_repo.thread... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
1013,
28216,
62,
74,
1878,
4914,
13,
28482,
1330,
32053,
11792,
11,
968,
33221,
198,
6738,
1013,
28216,
62,
74,
1878,
4914,
1330,
30436,
11,
18110,
11,
16000,
11,
46906,
12331,
11,
47373,... | 3.62963 | 189 |
#!/usr/bin/env python3.6
# coding=utf-8
'''
Scripts to train the model
@author: Chunchuan Lyu (chunchuan.lv@gmail.com)
@since: 2018-05-30
'''
from parser.Dict import *
from parser.DataIterator import *
from parser.BertDataIterator import *
import random
import json
from parser.models import *
import argparse
import... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
13,
21,
198,
2,
19617,
28,
40477,
12,
23,
198,
7061,
6,
198,
198,
7391,
82,
284,
4512,
262,
2746,
198,
198,
31,
9800,
25,
609,
3316,
7258,
9334,
84,
357,
354,
3316,
7258,
13,
6780... | 2.272466 | 6,254 |
# Training file based on the scikit learn example: Working With Text Data
# http://scikit-learn.org/stable/tutorial/text_analytics/working_with_text_data.html#loading-the-20-newsgroups-dataset
from sklearn.naive_bayes import MultinomialNB
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.... | [
2,
13614,
2393,
1912,
319,
262,
629,
1134,
270,
2193,
1672,
25,
14594,
2080,
8255,
6060,
198,
2,
2638,
1378,
36216,
15813,
12,
35720,
13,
2398,
14,
31284,
14,
83,
44917,
14,
5239,
62,
38200,
14094,
14,
16090,
62,
4480,
62,
5239,
62,... | 2.792808 | 584 |
#!/usr/bin/env python3
''' Create the monthly reports '''
# Run as the metrics user
# Three-letter items in square brackets (such as [xyz]) refer to parts of rssac-047.md
import argparse, datetime, glob, logging, math, os, psycopg2, statistics
if __name__ == "__main__":
# Get the base for the log directory
log_dir... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
7061,
6,
13610,
262,
9651,
3136,
705,
7061,
198,
2,
5660,
355,
262,
20731,
2836,
198,
2,
7683,
12,
9291,
3709,
287,
6616,
28103,
357,
10508,
355,
685,
5431,
89,
12962,
3522,... | 2.682 | 8,022 |
__all__ = ['Serializer', 'SerializerError']
from .nodes import *
| [
834,
439,
834,
796,
37250,
32634,
7509,
3256,
705,
32634,
7509,
12331,
20520,
198,
198,
6738,
764,
77,
4147,
1330,
1635,
628,
198
] | 2.956522 | 23 |
#------------------------------------------------------------------------------
# Copyright (c) 2012, Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------------------------
from .wx_constraints_widget import WxConstraintsWidget
class WxControl(WxConstraintsWidget):
... | [
2,
10097,
26171,
198,
2,
220,
15069,
357,
66,
8,
2321,
11,
2039,
28895,
11,
3457,
13,
198,
2,
220,
1439,
2489,
10395,
13,
198,
2,
10097,
26171,
198,
6738,
764,
49345,
62,
1102,
2536,
6003,
62,
42655,
1330,
370,
87,
3103,
2536,
600... | 4.288288 | 111 |
#import dependencies
from cgitb import text
import os
import csv
from unicodedata import name
# set csv path
csv_path = os.path.join("PyPoll/Resources/election_data.csv")
# create lists to store data
voter_id = []
candidate = []
# open and read csv file
with open(csv_path) as csvfile:
csvreader = csv.reader(csvf... | [
2,
11748,
20086,
198,
6738,
269,
18300,
65,
1330,
2420,
198,
11748,
28686,
198,
11748,
269,
21370,
198,
6738,
28000,
9043,
1045,
1330,
1438,
198,
198,
2,
900,
269,
21370,
3108,
198,
40664,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
72... | 2.761905 | 546 |
import numpy as np
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
| [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
28034,
13,
20471,
13,
17143,
2357,
1330,
25139,
2357,
628,
628,
628,
628,
628
] | 3.25 | 32 |
"""
Release the next version of DC/OS E2E.
"""
import datetime
import re
from pathlib import Path
from typing import Set
import click
from dulwich.porcelain import add, commit, push, tag_list
from dulwich.repo import Repo
from github import Github, Repository, UnknownObjectException
from binaries import make_linux_b... | [
37811,
198,
26362,
262,
1306,
2196,
286,
6257,
14,
2640,
412,
17,
36,
13,
198,
37811,
198,
198,
11748,
4818,
8079,
198,
11748,
302,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
5345,
198,
198,
11748,
3904,
198,
6738,
28... | 2.422036 | 2,033 |
"""
Find all prime factors of a given number
"""
| [
37811,
198,
16742,
477,
6994,
5087,
286,
257,
1813,
1271,
198,
37811,
628
] | 3.846154 | 13 |
val = []
while True:
val.append(int(input('Digite um valor: ')))
dec = str(input('Deseja continuar? [S/N]: ')).strip().upper()
if dec != 'S':
break
#respostas
print(f'Essa é a lista de valores: {val}')
print(f'{len(val)} essa foi a quantidade de números digitados')
#verificando se tem 5
if 5 in val... | [
2100,
796,
17635,
198,
4514,
6407,
25,
198,
220,
220,
220,
1188,
13,
33295,
7,
600,
7,
15414,
10786,
19511,
578,
23781,
1188,
273,
25,
705,
22305,
198,
220,
220,
220,
875,
796,
965,
7,
15414,
10786,
35,
2771,
6592,
11143,
283,
30,
... | 2.424581 | 537 |
"""Write mean-field trial wavefunctions to file."""
import numpy
import h5py
import itertools
import time
import sys
import scipy.linalg
from afqmctools.wavefunction.mol import write_qmcpack_wfn, write_nomsd_wfn
def write_wfn_pbc(scf_data, ortho_ao, filename, rediag=True,
verbose=False, ndet_max=None... | [
37811,
16594,
1612,
12,
3245,
4473,
6769,
12543,
2733,
284,
2393,
526,
15931,
198,
11748,
299,
32152,
198,
11748,
289,
20,
9078,
198,
11748,
340,
861,
10141,
198,
11748,
640,
198,
11748,
25064,
198,
11748,
629,
541,
88,
13,
75,
1292,
... | 2.105672 | 1,675 |
from pathlib import Path
from werkzeug.serving import make_ssl_devcert
from app import server
cert_path = Path(__file__).parent / "cert"
cert_file = cert_path / "dev.crt"
key_file = cert_path / "dev.key"
if cert_file.exists() and key_file.exists():
ssl_context = (cert_file, key_file)
else:
ssl_context = mak... | [
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
266,
9587,
2736,
1018,
13,
31293,
1330,
787,
62,
45163,
62,
7959,
22583,
198,
198,
6738,
598,
1330,
4382,
198,
198,
22583,
62,
6978,
796,
10644,
7,
834,
7753,
834,
737,
8000,
1220,
366,
... | 2.639752 | 161 |
import unittest
from flow.core.experiment import Experiment
from flow.core.params import SumoParams, SumoCarFollowingParams, NetParams, \
InFlows
from flow.core.params import VehicleParams
from flow.controllers.car_following_models import SimCarFollowingController
from flow.controllers.routing_controllers import G... | [
11748,
555,
715,
395,
198,
198,
6738,
5202,
13,
7295,
13,
23100,
3681,
1330,
29544,
198,
6738,
5202,
13,
7295,
13,
37266,
1330,
5060,
78,
10044,
4105,
11,
5060,
78,
9914,
14291,
10044,
4105,
11,
3433,
10044,
4105,
11,
3467,
198,
220,
... | 2.040732 | 2,185 |
# Copyright (c) 2016 Civic Knowledge. This file is licensed under the terms of the
# MIT License, included in this distribution as LICENSE.txt
"""Pipes, pipe segments and piplines, for flowing data from sources to partitions.
"""
from collections import OrderedDict
import inspect
import time
from tabulate import ta... | [
2,
15069,
357,
66,
8,
1584,
31593,
20414,
13,
770,
2393,
318,
11971,
739,
262,
2846,
286,
262,
198,
2,
17168,
13789,
11,
3017,
287,
428,
6082,
355,
38559,
24290,
13,
14116,
198,
198,
37811,
47,
18636,
11,
12656,
17894,
290,
279,
247... | 2.523519 | 9,503 |
import HydrusConstants as HC
import HydrusServerResources
import traceback
from twisted.web.server import Request, Site
from twisted.web.resource import Resource
import HydrusData
import time
LOCAL_DOMAIN = HydrusServerResources.HydrusDomain( True )
REMOTE_DOMAIN = HydrusServerResources.HydrusDomain( False )
... | [
11748,
15084,
14932,
34184,
1187,
355,
27327,
198,
11748,
15084,
14932,
10697,
33236,
198,
11748,
12854,
1891,
198,
6738,
19074,
13,
12384,
13,
15388,
1330,
19390,
11,
14413,
198,
6738,
19074,
13,
12384,
13,
31092,
1330,
20857,
198,
11748,
... | 2.83871 | 124 |
"""WizardKit: kit module init"""
# vim: sts=2 sw=2 ts=2
import platform
from . import tools
if platform.system() == 'Linux':
from . import ufd
if platform.system() == 'Windows':
from . import build_win as build
| [
37811,
54,
8669,
20827,
25,
6220,
8265,
2315,
37811,
198,
2,
43907,
25,
39747,
28,
17,
1509,
28,
17,
40379,
28,
17,
198,
198,
11748,
3859,
198,
198,
6738,
764,
1330,
4899,
198,
198,
361,
3859,
13,
10057,
3419,
6624,
705,
19314,
1035... | 3.041667 | 72 |
#!/usr/bin/env python
# Copyright 2021 Google LLC 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... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
33448,
3012,
11419,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
... | 3.197898 | 571 |
from typing import Set
from enforce_typing import enforce_types
from agents import MinterAgents
from agents.GrantGivingAgent import GrantGivingAgent
from agents.GrantTakingAgent import GrantTakingAgent
from agents.MarketplacesAgent import MarketplacesAgent
from agents.OCEANBurnerAgent import OCEANBurnerAgent
from age... | [
6738,
19720,
1330,
5345,
198,
198,
6738,
4605,
62,
774,
13886,
1330,
4605,
62,
19199,
198,
198,
6738,
6554,
1330,
1855,
353,
10262,
658,
198,
6738,
6554,
13,
45431,
49701,
36772,
1330,
12181,
49701,
36772,
198,
6738,
6554,
13,
45431,
26... | 3.813793 | 145 |
# -*- coding: utf-8 -*-
import numpy as np
np.set_printoptions(precision=3, linewidth=256)
from dyconnmap.fc import plv, PLV
if __name__ == "__main__":
data = np.load("/home/makism/Github/dyconnmap/examples/data/eeg_32chans_10secs.npy")
data = data[0:5, ]
ts, avg = plv(data, [1.0, 4.0], 128.0)
prin... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
299,
32152,
355,
45941,
198,
37659,
13,
2617,
62,
4798,
25811,
7,
3866,
16005,
28,
18,
11,
9493,
413,
5649,
28,
11645,
8,
198,
198,
6738,
20268,
37043,
889... | 1.957597 | 283 |
from django.shortcuts import render
from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView
from django.views.generic.base import RedirectView
from .forms import ShortenerForm
from .models import Enlace
# Create your views here.
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
13,
49170,
1330,
42585,
7680,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
13,
19312,
1330,
13610,
7680,
198,
6738,
42625,
14208,
13,
33571... | 3.794521 | 73 |
print("this is a try run")
| [
4798,
7203,
5661,
318,
257,
1949,
1057,
4943,
628
] | 3.111111 | 9 |
# Ivan Carvalho
# Solution to https://www.urionlinejudge.com.br/judge/problems/view/1171
#!/usr/bin/env python2.7
# -*- coding : utf-8 -*-
from collections import Counter
total = int(raw_input())
contador = Counter()
for i in xrange(total):
contador[int(raw_input())]+= 1
for a,b in sorted(contador.most_common()):
pri... | [
2,
21798,
1879,
2100,
8873,
198,
2,
28186,
284,
3740,
1378,
2503,
13,
40956,
1370,
10456,
469,
13,
785,
13,
1671,
14,
10456,
469,
14,
1676,
22143,
14,
1177,
14,
1157,
4869,
198,
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
13,
... | 2.553957 | 139 |
import socket
import threading
import room
PORT = 5050
SERVER = socket.gethostbyname(socket.gethostname())
ADDR = (SERVER, PORT)
FORMAT = "utf-8"
DISCONNECT_MESSAGE = "!DISCONNECT"
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(ADDR)
# room objects
rooms = []
# key: user_id; value: connectio... | [
11748,
17802,
198,
11748,
4704,
278,
198,
198,
11748,
2119,
198,
198,
15490,
796,
2026,
1120,
198,
35009,
5959,
796,
17802,
13,
1136,
4774,
1525,
3672,
7,
44971,
13,
1136,
4774,
3672,
28955,
198,
2885,
7707,
796,
357,
35009,
5959,
11,
... | 2.705479 | 146 |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
from setuptools import setup
setup(
name = 'TracExposeAttachmentPerms',
version = '1.0',
packages = ['exposeattachmentperms'],
author = 'Colin Snover',
author_email = 'tracplugins@zetafleet.com',
description = 'Expose attachment plugins for T... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
47279,
12,
3459,
3270,
12,
16,
532,
9,
12,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
796,
705,
2898,
... | 2.546392 | 291 |
import pandas
import numpy
import sklearn
import sklearn.neighbors
import sklearn.linear_model
import sklearn.metrics
import sklearn.svm
import sklearn.neural_network
# Load data
train = pandas.read_csv('WineQuality_Train.csv')
test = pandas.read_csv('WineQuality_Test.csv')
Y_train = train['quality_grp']
Y_test = test... | [
11748,
19798,
292,
198,
11748,
299,
32152,
198,
11748,
1341,
35720,
198,
11748,
1341,
35720,
13,
710,
394,
32289,
198,
11748,
1341,
35720,
13,
29127,
62,
19849,
198,
11748,
1341,
35720,
13,
4164,
10466,
198,
11748,
1341,
35720,
13,
82,
... | 2.296241 | 665 |
import numpy as np
from scipy.ndimage import map_coordinates, spline_filter
from scipy.sparse.linalg import factorized
from numerical import difference, operator
| [
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
358,
9060,
1330,
3975,
62,
37652,
17540,
11,
4328,
500,
62,
24455,
198,
6738,
629,
541,
88,
13,
82,
29572,
13,
75,
1292,
70,
1330,
5766,
1143,
198,
198,
6738,
29052,
1330,
... | 3.489362 | 47 |
#!/usr/bin/env python
from setuptools import setup
from feedformatter import __version__ as version
setup(
name='feedformatter',
version=version,
description='A Python library for generating news feeds in RSS and Atom formats',
author='Luke Maurits',
author_email='luke@maurits.id.au',
url='http... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
6738,
3745,
687,
1436,
1330,
11593,
9641,
834,
355,
2196,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
12363,
687,
1436,
3256,
198,
22... | 2.839506 | 162 |
from setuptools import setup, find_packages
VERSION='0.1'
long_description='A tool that stores AWS events from a resource to elastic search.'
packages=[
'elasticevents',
]
install_requires=[
'boto3',
'click',
]
if __name__ == '__main__':
main()
| [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
43717,
11639,
15,
13,
16,
6,
198,
198,
6511,
62,
11213,
11639,
32,
2891,
326,
7000,
30865,
2995,
422,
257,
8271,
284,
27468,
2989,
2637,
198,
43789,
41888,
198,
220,
... | 2.778947 | 95 |
from fastapi import FastAPI
from joblib import load
import numpy as np
import pandas as pd
app = FastAPI()
model = load('compressed_pipeline.pkl')
@app.post("/predict")
| [
6738,
3049,
15042,
1330,
12549,
17614,
198,
6738,
1693,
8019,
1330,
3440,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
1324,
796,
12549,
17614,
3419,
198,
198,
19849,
796,
3440,
10786,
5589,
2790,
... | 2.866667 | 60 |
""" TODO:
(From leftmost bit to rightmost bit)
Xbox Original Format:
07:Year
04:Month
05:Day
05:Hour
06:Minute
05:DoubleSeconds
Xbox 360 Format (OLD):
05:DoubleSeconds
06:Minute
05:Hour
05:Day
04:Month
07:Yea... | [
37811,
16926,
46,
25,
198,
220,
220,
220,
357,
4863,
1364,
1712,
1643,
284,
826,
1712,
1643,
8,
198,
220,
220,
220,
220,
220,
9445,
13745,
18980,
25,
198,
220,
220,
220,
220,
220,
220,
220,
8753,
25,
17688,
198,
220,
220,
220,
220... | 2.336283 | 452 |
"""
Simple painting demo that draws on an Adafruit capacitive touch shield with
ILI9341 display and STMPE610 resistive touch driver
"""
import busio
import board
import digitalio
import adafruit_stmpe610
from adafruit_rgb_display import ili9341, color565
# Create library object using our Bus SPI port
spi = busio.SPI(... | [
37811,
198,
26437,
12036,
13605,
326,
14293,
319,
281,
1215,
1878,
4872,
18457,
1800,
3638,
7614,
351,
198,
4146,
40,
24,
33660,
3359,
290,
3563,
7378,
36,
39132,
4180,
425,
3638,
4639,
198,
37811,
198,
198,
11748,
1323,
952,
198,
11748... | 2.262745 | 510 |
#these functions read and manage kiinteisto/adderess register either from local file
#or from given address
def kiinteisto(url):
"""reads kiinteisto data from Finnish registes
args:
url: the latest kiinteisto URL
Exsample of url = "https://www.avoindata.fi/data/dataset/cf92... | [
2,
27218,
5499,
1100,
290,
6687,
47748,
600,
68,
396,
78,
14,
2860,
68,
601,
7881,
2035,
422,
1957,
2393,
201,
198,
2,
273,
422,
1813,
2209,
201,
198,
201,
198,
201,
198,
4299,
47748,
600,
68,
396,
78,
7,
6371,
2599,
201,
198,
2... | 2.066376 | 1,838 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Author: violinsolo
# Created on 2019/4/19
'''import all'''
# Shortcuts
from .split_util import cnt_split, n_split, n_split_idx
'''define all'''
__all__ = ['cnt_split', 'n_split', 'n_split_idx']
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
6434,
25,
1935,
1040,
14057,
198,
2,
15622,
319,
13130,
14,
19,
14,
1129,
198,
7061,
6,
11748,
477,
7061,
6,
198,
2,
... | 2.320388 | 103 |
# -*- coding: utf-8 -*-
#!/usr/bin/python
#test_copyfile.py
import os,shutil
import pathlib
srcfile='/home/andy/test.py'
dstfile='/home/andy/devWorkSpace/test.py'
mymovefile(srcfile,dstfile)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
2,
48443,
14629,
14,
8800,
14,
29412,
201,
198,
2,
9288,
62,
30073,
7753,
13,
9078,
201,
198,
201,
198,
11748,
28686,
11,
1477,
22602,
201,
198,
11748,
3108,
8019... | 2.113402 | 97 |
from .sacred_reader import SacredReader
from .sacred_config import SacredConfigFactory
from .sacred_writer import SacredWriter
from .serializable_model import Serializable
from .sacred_utils import SacredUtils
from .sacred_config import SacredConfig
from .gridfs_reader import GridFSReader | [
6738,
764,
30584,
445,
62,
46862,
1330,
17380,
33634,
198,
6738,
764,
30584,
445,
62,
11250,
1330,
17380,
16934,
22810,
198,
6738,
764,
30584,
445,
62,
16002,
1330,
17380,
34379,
198,
6738,
764,
46911,
13821,
62,
19849,
1330,
23283,
13821... | 4.013889 | 72 |
"""
Script to load the first trained model (by running first_try_training.py) and view the quality of infilling
"""
from ai_ct_scans.model_trainers import InfillTrainer
import torch
import numpy as np
import matplotlib.pyplot as plt
from ai_ct_scans.data_loading import data_root_directory
if torch.cuda.is_available()... | [
37811,
198,
7391,
284,
3440,
262,
717,
8776,
2746,
357,
1525,
2491,
717,
62,
28311,
62,
34409,
13,
9078,
8,
290,
1570,
262,
3081,
286,
1167,
4509,
198,
37811,
198,
198,
6738,
257,
72,
62,
310,
62,
1416,
504,
13,
19849,
62,
27432,
... | 2.232824 | 1,572 |
import random
" All important methods of Doubly Linked List can be found here"
# list = LinkedList()
# list.add(2)
# list.add(5)
# list.add(7)
# list.add(6)
# list.add(8)
# list.add(8)
# # list.generate_values(15, 1, 9)
# print(list)
# # print(len(list))
#
# list.delete(5)
# print(list)
# list.reverse()
# print(l... | [
11748,
4738,
198,
198,
1,
1439,
1593,
5050,
286,
5728,
36874,
7502,
276,
7343,
460,
307,
1043,
994,
1,
628,
628,
198,
2,
1351,
796,
7502,
276,
8053,
3419,
198,
2,
1351,
13,
2860,
7,
17,
8,
198,
2,
1351,
13,
2860,
7,
20,
8,
198... | 2.347305 | 167 |
import collections
| [
11748,
17268,
198
] | 6.333333 | 3 |
import argparse
import torch
from collections import OrderedDict
from os.path import isdir
import os.path
from PIL import Image
import numpy as np
import json
from torch import nn
from torch import optim
from torchvision import datasets, transforms, models
if __name__ == '__... | [
11748,
1822,
29572,
198,
11748,
28034,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
28686,
13,
6978,
1330,
318,
15908,
198,
11748,
28686,
13,
6978,
220,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
299,
32152,
355,
45941,
1... | 2.815126 | 119 |