content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import logging
import pickle
| [
11748,
18931,
198,
11748,
2298,
293,
628,
198
] | 3.875 | 8 |
from firechannel import get_client
| [
6738,
2046,
17620,
1330,
651,
62,
16366,
628,
628
] | 4.222222 | 9 |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class FilesConfig(AppConfig):
"""Configuration for ``Files`` app."""
name = 'apps.files'
verbose_name = _('Files')
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
628,
198,
4871,
13283,
16934,
7,
4677,
16934,
2599,
198,
220,
220,
220,
37227,
38149,
329,... | 3.055556 | 72 |
#standard libraries
import time
from datetime import datetime
import csv
import os
import json
from concurrent import futures
import threading
import multiprocessing
import math
#external libraries
import numpy as np
import pandas as pd
from discord import Webhook, RequestsWebhookAdapter
from binance.client import Cli... | [
2,
20307,
12782,
198,
11748,
640,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
269,
21370,
198,
11748,
28686,
198,
11748,
33918,
198,
6738,
24580,
1330,
25650,
198,
11748,
4704,
278,
198,
11748,
18540,
305,
919,
278,
198,
11748,
... | 3.316667 | 300 |
import matplotlib.pyplot as plt
import time
from datetime import datetime
import os
import os.path
from tkinter import filedialog
import tkinter as tk
import ast
import openpyxl
import pandas as pd
from pandas.io.json import json_normalize
import numpy as np
# import random
## #create combined... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
11748,
640,
201,
198,
6738,
4818,
8079,
1330,
4818,
8079,
201,
198,
11748,
28686,
201,
198,
11748,
28686,
13,
6978,
201,
198,
6738,
256,
74,
3849,
1330,
5717,
498,
519... | 1.777639 | 2,406 |
from onegov.activity.collections.activity import ActivityFilter
from onegov.activity.collections.activity import ActivityCollection
from onegov.activity.collections.attendee import AttendeeCollection
from onegov.activity.collections.booking import BookingCollection
from onegov.activity.collections.invoice import Invoic... | [
6738,
530,
9567,
13,
21797,
13,
4033,
26448,
13,
21797,
1330,
24641,
22417,
198,
6738,
530,
9567,
13,
21797,
13,
4033,
26448,
13,
21797,
1330,
24641,
36307,
198,
6738,
530,
9567,
13,
21797,
13,
4033,
26448,
13,
1078,
437,
1453,
1330,
... | 3.7173 | 237 |
""" This file contains SPRKKRAtoms - an enhanced version of Atoms to be used
with SPRKKR """
from ase import Atoms
from ..common.unique_values import UniqueValuesMapping
import spglib
from ase.spacegroup import Spacegroup
import numpy as np
from ..sprkkr.sites import Site
from ..common.misc import numpy_index
class ... | [
37811,
770,
2393,
4909,
49068,
16601,
49,
2953,
3150,
532,
281,
13105,
2196,
286,
1629,
3150,
284,
307,
973,
198,
4480,
49068,
16601,
49,
37227,
628,
198,
6738,
257,
325,
1330,
1629,
3150,
198,
6738,
11485,
11321,
13,
34642,
62,
27160,
... | 2.392051 | 4,428 |
'''
It would be nice if this module didn't need to import anything,
since it defines (part of) the syntax of the language, and that
and that seems like something that should be completely abstract.
But macros make it possible to alter the syntax at run-time,
meaning that keyword dispatch has to be c... | [
7061,
6,
198,
220,
220,
220,
632,
561,
307,
3621,
611,
428,
8265,
1422,
470,
761,
284,
1330,
1997,
11,
198,
220,
220,
220,
1201,
340,
15738,
357,
3911,
286,
8,
262,
15582,
286,
262,
3303,
11,
290,
326,
198,
220,
220,
220,
290,
3... | 2.943765 | 409 |
from datetime import datetime, timedelta
from unittest.mock import MagicMock
import pytest
from scrapy.exceptions import DropItem
from city_scrapers_core.constants import CANCELLED
from city_scrapers_core.decorators import ignore_jscalendar
from city_scrapers_core.items import Meeting
from city_scrapers_core.pipeline... | [
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
198,
198,
11748,
12972,
9288,
198,
6738,
15881,
88,
13,
1069,
11755,
1330,
14258,
7449,
198,
198,
6738,
1748,
62,
1416,
... | 2.955128 | 156 |
# -*- coding: utf-8 -*-
import scrapy
import json
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
15881,
88,
198,
11748,
33918,
198,
198,
6738,
7064,
13,
23814,
1330,
2269,
13210,
1559,
12727,
7449,
198,
6738,
7064,
13,
24425,
1330,
25522,
39792,
628
] | 3.365854 | 41 |
import unittest
from stensorflow.basic.protocol.module_transform import module_transform,\
module_transform_withPRF
import numpy as np
from stensorflow.basic.basic_class.base import SharedTensorBase, SharedPairBase
from stensorflow.global_var import StfConfig
import tensorflow as tf
from stensorflow.engine.start_se... | [
11748,
555,
715,
395,
198,
6738,
336,
22854,
11125,
13,
35487,
13,
11235,
4668,
13,
21412,
62,
35636,
1330,
8265,
62,
35636,
11,
59,
198,
220,
220,
220,
8265,
62,
35636,
62,
4480,
4805,
37,
198,
11748,
299,
32152,
355,
45941,
198,
6... | 2.994186 | 172 |
#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
2,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
66,
8,
33448,
8180,
10501,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
... | 2.561159 | 932 |
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
355,
4808,
628
] | 3.6 | 25 |
"""
platform that offers a connection to a warmup4ie device.
this platform is inspired by the following code:
https://github.com/alyc100/SmartThingsPublic/tree/master/devicetypes/alyc100/\
warmup-4ie.src
to setup this component, you need to register to warmup first.
see
https://my.warmup.com/login
Then add to your
c... | [
37811,
198,
24254,
326,
4394,
257,
4637,
284,
257,
5814,
929,
19,
494,
3335,
13,
198,
198,
5661,
3859,
318,
7867,
416,
262,
1708,
2438,
25,
198,
5450,
1378,
12567,
13,
785,
14,
3400,
66,
3064,
14,
25610,
22248,
15202,
14,
21048,
14,... | 2.106572 | 7,319 |
number_list = [x for x in range(1, 21)]
print(number_list)
filtered_list = filter(lambda x: x%2==0, number_list)
filtered_list = list(filtered_list)
print(filtered_list)
square_list = map(lambda x: x**2, filtered_list)
square_list = list(square_list)
print(square_list)
# filter(func, iterable)
# map(func, iterable... | [
17618,
62,
4868,
796,
685,
87,
329,
2124,
287,
2837,
7,
16,
11,
2310,
15437,
198,
198,
4798,
7,
17618,
62,
4868,
8,
198,
10379,
4400,
62,
4868,
796,
8106,
7,
50033,
2124,
25,
2124,
4,
17,
855,
15,
11,
1271,
62,
4868,
8,
198,
1... | 2.596774 | 124 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
#
| [
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
220,
198,
2,
49962,
739,
262,
17168,
13789,
13,
220,
198,
2,
628,
628,
628,
628
] | 3.75 | 28 |
"""
Components/Text Field
=====================
.. seealso::
`Material Design spec, Text fields <https://material.io/components/text-fields>`_
.. rubric:: Text fields let users enter and edit text.
.. image:: https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/text-fields.png
:align: cent... | [
37811,
198,
7293,
3906,
14,
8206,
7663,
198,
4770,
1421,
28,
198,
198,
492,
766,
14508,
3712,
628,
220,
220,
220,
4600,
17518,
8495,
1020,
11,
8255,
7032,
1279,
5450,
1378,
33665,
13,
952,
14,
5589,
3906,
14,
5239,
12,
25747,
29,
63... | 2.147641 | 6,719 |
from django.db import models
from django.contrib.auth.models import AbstractUser, Group, User
# Create your models here.
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
27741,
12982,
11,
4912,
11,
11787,
198,
2,
13610,
534,
4981,
994,
13,
198
] | 3.666667 | 33 |
"""
Orca Extractor
=============
#. :class:`.OrcaExtractor`
Class to extract properties from Orca output.
"""
import re
from .extractor import Extractor
class OrcaExtractor(Extractor):
"""
Extracts properties from Orca 4.2 output files.
Limited to final single point energy for now.
Attributes
... | [
37811,
198,
5574,
6888,
29677,
273,
198,
25609,
28,
198,
198,
2,
13,
1058,
4871,
25,
44646,
5574,
6888,
11627,
40450,
63,
198,
198,
9487,
284,
7925,
6608,
422,
1471,
6888,
5072,
13,
198,
198,
37811,
198,
198,
11748,
302,
198,
6738,
... | 2.296923 | 650 |
# Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | [
2,
15069,
357,
66,
8,
12131,
43208,
21852,
1766,
1539,
12052,
198,
2,
15069,
357,
66,
8,
13130,
11,
3203,
23929,
44680,
6234,
13,
220,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
347,
10305,
513,
12,
2601,
682,... | 3.851064 | 188 |
from fabric.api import sudo, settings
from .task import Task
from .containers import conf
from .utils import upload_config_template
from . import system
from . import pip
__all__ = [
'install_deps',
'install',
'push_config',
'disable_config',
'emperor',
]
install_deps = InstallDeps()
install ... | [
6738,
9664,
13,
15042,
1330,
21061,
11,
6460,
198,
198,
6738,
764,
35943,
1330,
15941,
198,
6738,
764,
3642,
50221,
1330,
1013,
198,
6738,
764,
26791,
1330,
9516,
62,
11250,
62,
28243,
198,
6738,
764,
1330,
1080,
198,
6738,
764,
1330,
... | 3.036232 | 138 |
#!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Copyright (c) 2018 The Zencash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
2,
15069,
357,
66,
8,
1946,
383,
6185,
7231,
6505,
198,
2,
15069,
357,
66,
8,
2864,
383,
1168,
12685,
1077,
6505,
198,
2,
4307,
6169,
739,
262,
17168,
3788,
5964,
11,
766,
262,... | 3.324895 | 237 |
if __name__ == '__main__':
a = int(input("input a number: \n"))
b = a >> 4
c = ~(~0 << 4)
d = b & c
print("%o\t%o" % (a, d))
| [
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
257,
796,
493,
7,
15414,
7203,
15414,
257,
1271,
25,
3467,
77,
48774,
198,
220,
220,
220,
275,
796,
257,
9609,
604,
198,
220,
220,
220,
269,
796,
5299,
... | 1.858974 | 78 |
from celery import Celery, signals, Task
from datetime import datetime, timezone, timedelta, date
from math import floor
import requests
import pymssql
import json
import twitterWebsiteSearch.TwitterWebsiteSearch as twitSearch
app = Celery('tasks')
app.config_from_object('celeryconfig')
'''
'''
@signals.worker_pro... | [
6738,
18725,
1924,
1330,
15248,
1924,
11,
10425,
11,
15941,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
640,
11340,
11,
28805,
12514,
11,
3128,
198,
6738,
10688,
1330,
4314,
198,
198,
11748,
7007,
198,
11748,
279,
4948,
824,
13976,
198... | 2.764957 | 234 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import ssl as pyssl
from functools import partial
from pika import (
BasicProperties,
BlockingConnection,
ConnectionParameters,
PlainCredentials,
SelectConnection,
SSLOptions,
URLParameters,
)
from pika.exception... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
18931,
198,
11748,
264,
6649,
355,
12972,
45163,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
198,
6738,... | 2.363071 | 9,169 |
from norm.executable import NormError, NormExecutable
from norm.models import ListLambda, Lambda, Variable, Status
import logging
logger = logging.getLogger(__name__)
| [
6738,
2593,
13,
18558,
18187,
1330,
11220,
12331,
11,
11220,
23002,
18187,
198,
6738,
2593,
13,
27530,
1330,
7343,
43,
4131,
6814,
11,
21114,
6814,
11,
35748,
11,
12678,
198,
198,
11748,
18931,
198,
6404,
1362,
796,
18931,
13,
1136,
111... | 3.489796 | 49 |
import re
from allauth.account.forms import SignupForm
from django import forms as form2
from django.contrib.auth import forms as admin_forms
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
User = get_user_model()
| [
11748,
302,
198,
198,
6738,
477,
18439,
13,
23317,
13,
23914,
1330,
5865,
929,
8479,
198,
6738,
42625,
14208,
1330,
5107,
355,
1296,
17,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
5107,
355,
13169,
62,
23914,
198,
6738,
... | 3.313253 | 83 |
#!/usr/bin/env python
#
# ----------------------------------------------------------------------
#
# Brad T. Aagaard
# U.S. Geological Survey
#
# <LicenseText>
#
# ----------------------------------------------------------------------
#
## @file cencalvm/__init__.py
##
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
16529,
23031,
198,
2,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8114,
... | 2.818792 | 149 |
"""
A bunch of variables that are intended
to be shared across the Flask codebase
"""
from flask import Flask
import db
import logging
MAIN_APP = Flask(__name__)
LOGGER = MAIN_APP.logger
LOGGER.setLevel(logging.INFO)
MAIN_DB = db.Database(MAIN_APP).getDb()
POSSIBLE_NEEDS = [
'N95',
'N95s',
'Gloves',
... | [
37811,
198,
32,
7684,
286,
9633,
326,
389,
5292,
198,
1462,
307,
4888,
1973,
262,
46947,
2438,
8692,
198,
37811,
198,
198,
6738,
42903,
1330,
46947,
198,
11748,
20613,
198,
11748,
18931,
198,
198,
5673,
1268,
62,
24805,
796,
46947,
7,
... | 2.424242 | 231 |
from django.db.models import Q
from contacts.models import Contact
from contacts.serializer import ContactSerializer
from common.models import User, Attachments, Comment
from common.custom_auth import JSONWebTokenAuthentication
from common.serializer import (
UserSerializer,
CommentSerializer,
AttachmentsS... | [
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
198,
6738,
13961,
13,
27530,
1330,
14039,
198,
6738,
13961,
13,
46911,
7509,
1330,
14039,
32634,
7509,
198,
198,
6738,
2219,
13,
27530,
1330,
11787,
11,
3460,
620,
902,
11,
18957,
198... | 3.582043 | 323 |
import numpy as np
from ecog.signal_processing import linenoise_notch
def test_linenoise_notch_return():
"""
Test the return shape.
"""
X = np.random.randn(32, 1000)
rate = 200
Xh = linenoise_notch(X, rate)
assert Xh.shape == X.shape
| [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
9940,
519,
13,
12683,
282,
62,
36948,
1330,
9493,
23397,
786,
62,
1662,
354,
198,
198,
4299,
1332,
62,
2815,
23397,
786,
62,
1662,
354,
62,
7783,
33529,
198,
220,
220,
220,
37227,
198,
... | 2.378378 | 111 |
#Splitter
import cv2
import numpy.random as random
import numpy as np
import os
import time
import skimage.io as io
from AGCWD import*
#borders
#mitochondria
#mitochondria borders
#PSD
#vesicles
file_dir_arr = ["axon", "mitochondria", "PSD", "vesicles", "boundaries","mitochondrial boundaries"]
name_list = []
ma... | [
2,
26568,
1967,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
13,
25120,
355,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
640,
198,
198,
11748,
1341,
9060,
13,
952,
355,
33245,
198,
6738,
13077,
34... | 2.07153 | 1,412 |
import pytest
from backend.common.consts.auth_type import AuthType
from backend.common.models.api_auth_access import ApiAuthAccess
| [
11748,
12972,
9288,
198,
198,
6738,
30203,
13,
11321,
13,
1102,
6448,
13,
18439,
62,
4906,
1330,
26828,
6030,
198,
6738,
30203,
13,
11321,
13,
27530,
13,
15042,
62,
18439,
62,
15526,
1330,
5949,
72,
30515,
15457,
628,
628,
628,
628,
6... | 3.325581 | 43 |
import os
import hashlib | [
11748,
28686,
198,
11748,
12234,
8019
] | 4 | 6 |
#!/usr/bin/python
import boto3
import click
from pybase64 import b64encode
from asym_crypto_yaml import (
load, Encrypted, decrypt_value,
load_private_key_from_file,
load_private_key_from_string
)
def perform_deploy_lambda_envs(config_file_path, private_key_content, private_key_path, kms_key_arn, lambda... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
275,
2069,
18,
198,
11748,
3904,
198,
6738,
12972,
8692,
2414,
1330,
275,
2414,
268,
8189,
198,
198,
6738,
355,
4948,
62,
29609,
78,
62,
88,
43695,
1330,
357,
198,
220,
220,
220... | 2.503241 | 1,234 |
import numpy as np
import re
import random
import json
import collections
import parameters as params
import pickle
import nltk
# args = params.argparser("lstm petModel-0 --keep_rate 0.9 --seq_length 25 --emb_train")
# FIXED_PARAMETERS = params.load_parameters(args)
FIXED_PARAMETERS = params.load_parameters()
LABEL... | [
11748,
299,
32152,
355,
45941,
198,
11748,
302,
198,
11748,
4738,
198,
11748,
33918,
198,
11748,
17268,
198,
11748,
10007,
355,
42287,
198,
11748,
2298,
293,
198,
11748,
299,
2528,
74,
198,
198,
2,
26498,
796,
42287,
13,
853,
48610,
720... | 2.073798 | 4,702 |
from __future__ import unicode_literals
import re
from collections import OrderedDict, defaultdict
from conllu.compat import text
DEFAULT_FIELDS = ('id', 'form', 'lemma', 'upostag', 'xpostag', 'feats', 'head', 'deprel', 'deps', 'misc')
INTEGER = re.compile(r"^0|(\-?[1-9][0-9]*)$")
ID_SINGLE = re.compile(r"^[1-9]... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
302,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
11,
4277,
11600,
198,
198,
6738,
369,
297,
84,
13,
5589,
265,
1330,
2420,
198,
198,
7206,
38865,
62,
11674... | 1.949153 | 295 |
import numpy as np
from skimage.morphology import medial_axis
from skimage.util import invert
| [
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
9060,
13,
24503,
1435,
1330,
48174,
62,
22704,
198,
6738,
1341,
9060,
13,
22602,
1330,
287,
1851,
628,
628
] | 3.592593 | 27 |
# -*- coding: utf-8 -*-
import sys
import os
import json
import http.client
import urllib
sys.path.append('../')
from utils.NetworkingUtils import NetworkingUtils
from utils.ConstantUtils import ConstantUtils
'''
The methods of this class manage requests that are related to the Github information stored in
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
2638,
13,
16366,
198,
11748,
2956,
297,
571,
198,
198,
17597,
13,
6978,
13,
33295,
10786,
40720,
11537... | 3.416667 | 192 |
import torch
from .BaseEmbeddingModel import BaseEmbeddingModel
| [
11748,
28034,
198,
198,
6738,
764,
14881,
31567,
6048,
278,
17633,
1330,
7308,
31567,
6048,
278,
17633,
628
] | 3.666667 | 18 |
#
# Copyright (C) 2010-2017 Samuel Abels
# The MIT License (MIT)
#
# 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,... | [
2,
198,
2,
15069,
357,
34,
8,
3050,
12,
5539,
17100,
2275,
1424,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
198,
2,
257,
4866,
286,
428... | 3.321577 | 482 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.j... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
1946,
41689,
1628,
20420,
357,
3826,
27342,
9865,
3843,
20673,
13,
9132,
737,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
3826,
38559,
24290,
737,
198,
198,
6738,
1... | 3.08982 | 167 |
from .merchant_authorization import MerchantAuthorizationClient
from .merchant_client import MerchantClient
__version__ = "0.0.5"
| [
6738,
764,
647,
8907,
62,
9800,
1634,
1330,
33508,
13838,
1634,
11792,
198,
6738,
764,
647,
8907,
62,
16366,
1330,
33508,
11792,
198,
198,
834,
9641,
834,
796,
366,
15,
13,
15,
13,
20,
1,
198
] | 3.638889 | 36 |
from random import uniform
from time import sleep
from typing import List, Optional, Union
from airflow.exceptions import AirflowException
from airflow.hooks.base import BaseHook
from airflow.utils.log.logging_mixin import LoggingMixin
from spell.client import SpellClient as ExternalSpellClient
from spell.client.runs ... | [
6738,
4738,
1330,
8187,
198,
6738,
640,
1330,
3993,
198,
6738,
19720,
1330,
7343,
11,
32233,
11,
4479,
198,
198,
6738,
45771,
13,
1069,
11755,
1330,
3701,
11125,
16922,
198,
6738,
45771,
13,
25480,
82,
13,
8692,
1330,
7308,
39,
566,
1... | 2.880982 | 815 |
# -*- coding: utf-8 -*-
'''
Python classes that are shared between
LiveProxy main.py and Kodi service.liveproxy
'''
import logging
import os
import sys
import streamlink.logger as logger
log = logging.getLogger('streamlink.liveproxy-shared')
__all__ = [
'check_root',
'logger',
'setup_logging... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
220,
220,
220,
11361,
6097,
326,
389,
4888,
1022,
198,
220,
220,
220,
220,
220,
7547,
44148,
1388,
13,
9078,
290,
44129,
2139,
13,
12583,
36436,
198,
706... | 2.68595 | 121 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
"""
This is the main class that runs all of the validations.
This class handles the overall logic to:
* Copy the file to lo... | [
2,
15069,
357,
66,
8,
30277,
19193,
82,
11,
3457,
13,
290,
29116,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,
262,
6808,
8619,
286,
428,
2723,
5509,
13,
... | 3.516605 | 271 |
import argparse
from Secure_Server import secure_server_start
from Secure_Client import secure_client_start
from Server import unsecure_server_start
from Client import unsecure_client_start
from MITM import mitm_start
parser = argparse.ArgumentParser(description='Choose whether to run a client or a server, and whether... | [
11748,
1822,
29572,
198,
6738,
26707,
62,
10697,
1330,
5713,
62,
15388,
62,
9688,
198,
6738,
26707,
62,
11792,
1330,
5713,
62,
16366,
62,
9688,
198,
6738,
9652,
1330,
555,
22390,
62,
15388,
62,
9688,
198,
6738,
20985,
1330,
555,
22390,
... | 2.968523 | 413 |
from typing import cast
from aws_cdk import aws_iam as iam
from aws_cdk import core as cdk
from api.infra import API
from db.infra import Database
| [
6738,
19720,
1330,
3350,
198,
198,
6738,
3253,
82,
62,
10210,
74,
1330,
3253,
82,
62,
1789,
355,
1312,
321,
198,
6738,
3253,
82,
62,
10210,
74,
1330,
4755,
355,
22927,
74,
198,
198,
6738,
40391,
13,
10745,
430,
1330,
7824,
198,
6738... | 3 | 50 |
"""This script allows use of an IDE (Wing, Pycharm, ...) to run the rasa shell:
(-) Place this script in root of Rasa bot project
(-) Open & run it from within your IDE
(-) In Wing, use External Console for better experience.
"""
import os
import sys
# insert path of this script in syspath so custom modules will be... | [
37811,
1212,
4226,
3578,
779,
286,
281,
33497,
357,
35612,
11,
9485,
354,
1670,
11,
2644,
8,
284,
1057,
262,
374,
15462,
7582,
25,
198,
198,
7,
25106,
8474,
428,
4226,
287,
6808,
286,
371,
15462,
10214,
1628,
198,
7,
25106,
4946,
12... | 2.962085 | 211 |
#-*-coding:utf-8-*-
from flask import Flask, render_template
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_moment import Moment
from flask_login import LoginManager
from flask_pagedown import PageDown
from config import config
import os
from f... | [
2,
12,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
198,
6738,
42903,
62,
18769,
26418,
1330,
18892,
26418,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198... | 3.560976 | 164 |
from dragonfly import Grammar, CompoundRule
pythonBootstrap = Grammar("python bootstrap")
pythonBootstrap.add_rule(PythonEnabler())
pythonBootstrap.load()
pythonGrammar = Grammar("python grammar")
pythonGrammar.load()
pythonGrammar.disable()
| [
6738,
10441,
12254,
1330,
20159,
3876,
11,
3082,
633,
31929,
628,
628,
198,
29412,
36476,
26418,
796,
20159,
3876,
7203,
29412,
6297,
26418,
4943,
198,
29412,
36476,
26418,
13,
2860,
62,
25135,
7,
37906,
4834,
397,
1754,
28955,
198,
29412... | 3.306667 | 75 |
import pandas as pd
import pandera as pa
df = pd.read_csv('ocorrencia.csv', parse_dates=['ocorrencia_dia'], dayfirst=True) #fazer a leitura da tablea, parse_data: faz a conversão para data e dayfirst: faz com que o dia seja o primeiro número
df.head(10)
schema = pa.DataFrameSchema( #cria um esquema para o data frame ... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
279,
4066,
64,
355,
14187,
198,
198,
7568,
796,
279,
67,
13,
961,
62,
40664,
10786,
420,
273,
918,
33743,
13,
40664,
3256,
21136,
62,
19581,
28,
17816,
420,
273,
918,
33743,
62,
67,
544,
... | 2.341421 | 577 |
import numpy as np
import os
import sqlite3
from . import SubCatalogMixin
__all__ = ["SQLSubCatalogMixin"]
class SQLSubCatalogMixin(SubCatalogMixin):
"""
This is a SubCatalog mixin class that writes
its output to a sqlite database, rather than
a text file.
Note: subcatalogs in the same CompoundIn... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
44161,
578,
18,
198,
6738,
764,
1330,
3834,
49015,
35608,
259,
198,
198,
834,
439,
834,
796,
14631,
50,
48,
6561,
549,
49015,
35608,
259,
8973,
198,
198,
4871,
49747,
6561,
... | 2.149956 | 2,294 |
"""Directives for building command blocks."""
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx.util.docutils import SphinxDirective
class CommandBlockDirective(SphinxDirective):
"""Generate a container node with a command, its prompt and optional output."""
has_content = Tr... | [
37811,
13470,
1083,
329,
2615,
3141,
7021,
526,
15931,
198,
198,
6738,
2205,
26791,
1330,
13760,
198,
6738,
2205,
26791,
13,
79,
945,
364,
13,
81,
301,
1330,
34819,
198,
6738,
599,
20079,
87,
13,
22602,
13,
15390,
26791,
1330,
45368,
... | 3.197452 | 157 |
'''
Config example:
{
"subject" : "Daily backup",
"body" : "This is a daily database backup",
"sender_email" : "sender@gmail.com",
"receiver_email" : "receiver@gmail.com",
"password" : "supersecretpassword",
"smtp_server" : "smtp.gmail.com",
"smtp_host" : 465,
"dbname" : "d... | [
7061,
6,
201,
198,
201,
198,
201,
198,
16934,
1672,
25,
201,
198,
90,
201,
198,
220,
220,
220,
366,
32796,
1,
1058,
366,
28545,
11559,
1600,
201,
198,
220,
220,
220,
366,
2618,
1,
1058,
366,
1212,
318,
257,
4445,
6831,
11559,
1600... | 2.614573 | 1,043 |
# Test Case
linked_list = LinkedList([5, 7, -1, 0.9, 71])
print("Linked List tests:")
print (" Initialization: " + "Pass" if (linked_list.to_list() == [5, 7, -1, 0.9, 71]) else "Fail")
linked_list.delete(-1)
print (" Delete: " + "Pass" if (linked_list.to_list() == [5, 7, 0.9, 71]) else "Fail")
print (" ... | [
198,
2,
6208,
8913,
198,
25614,
62,
4868,
796,
7502,
276,
8053,
26933,
20,
11,
767,
11,
532,
16,
11,
657,
13,
24,
11,
9166,
12962,
198,
4798,
7203,
11280,
276,
7343,
5254,
25,
4943,
198,
4798,
5855,
220,
20768,
1634,
25,
366,
1343... | 2.272109 | 294 |
#!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, 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 ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
15069,
2864,
12,
42334,
12280,
897,
261,
11,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
... | 3.41453 | 234 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | [
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,... | 2.996785 | 622 |
import os.path
import sublime_plugin
| [
11748,
28686,
13,
6978,
198,
198,
11748,
41674,
62,
33803,
628
] | 3.545455 | 11 |
from django.db import models as m
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
355,
285,
628
] | 3.5 | 10 |
# https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/
# 123. Best Time to Buy and Sell Stock III(Hard) Solution
# Say you have an array for which the ith element is the price of a given stock on day i.
# Design an algorithm to find the maximum profit. You may complete at most two transactions.
# Note: ... | [
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
13466,
12,
2435,
12,
1462,
12,
17846,
12,
392,
12,
7255,
12,
13578,
12,
15479,
14,
198,
2,
17031,
13,
6705,
3862,
284,
11763,
290,
25688,
10500,
6711,
7,
17309,
8,
28186... | 3.230769 | 169 |
# Copyright 2014-2017 Insight Software Consortium.
# Copyright 2004-2009 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
import os
import pycodestyle
import unittest
import fnmatch
if __name__ == "__main__":
run_suite()
| [
2,
15069,
1946,
12,
5539,
39917,
10442,
42727,
13,
198,
2,
15069,
5472,
12,
10531,
7993,
30254,
16206,
7204,
13,
198,
2,
4307,
6169,
739,
262,
19835,
10442,
13789,
11,
10628,
352,
13,
15,
13,
198,
2,
4091,
2638,
1378,
2503,
13,
3952... | 3.123711 | 97 |
"""Classes for creating DNS zones and writing corresponding zone
files.
No validation is done here (e.g. requiring a SOA record) because this
module may be used to create fragments of zone files to be used via an
$INCLUDE directive. Users of this module are encouraged to employ an
external validation process like name... | [
37811,
9487,
274,
329,
4441,
18538,
14123,
290,
3597,
11188,
6516,
198,
16624,
13,
198,
198,
2949,
21201,
318,
1760,
994,
357,
68,
13,
70,
13,
10616,
257,
12809,
32,
1700,
8,
780,
428,
198,
21412,
743,
307,
973,
284,
2251,
21441,
28... | 2.239192 | 3,863 |
# Copyright 2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
2,
15069,
2211,
2297,
10983,
11,
3457,
13,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
407,
779,
428,
2393,
2845,
287,
11846... | 2.840261 | 1,227 |
# encoding:utf-8
import os
import torch
import torch.nn.functional as F
import torch.optim as optim
import torchvision
from torchvision import transforms as T
from torchvision.datasets import ImageFolder
from torch.autograd import Variable
from torch.utils.data import DataLoader
from models.discriminator import Discrim... | [
2,
21004,
25,
40477,
12,
23,
198,
11748,
28686,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
28034,
13,
40085,
355,
6436,
198,
11748,
28034,
10178,
198,
6738,
28034,
10178,
1330,
31408,
355,
309,
198... | 4.020408 | 98 |
import sys
from PyQt5.QtWidgets import (QApplication, QWidget, QPushButton, QLabel, QLineEdit, QGridLayout, QMessageBox)
if __name__ == '__main__':
app = QApplication(sys.argv)
form = LoginForm()
form.show()
sys.exit(app.exec_())
| [
11748,
25064,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
357,
48,
23416,
11,
1195,
38300,
11,
1195,
49222,
21864,
11,
1195,
33986,
11,
1195,
13949,
18378,
11,
1195,
41339,
32517,
11,
1195,
12837,
14253,
8,
628,
1... | 2.535354 | 99 |
import unittest
import random
import math
from pynsga3 import utils
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
11748,
4738,
198,
11748,
10688,
198,
198,
6738,
279,
2047,
82,
4908,
18,
1330,
3384,
4487,
628,
628,
220,
220,
220,
220,
220,
220,
220,
220,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
1... | 2.433962 | 53 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# _version.py
"""Package initialization for IQDM-PDF."""
# Copyright (c) 2021 Dan Cutright
# This file is part of IQDM-PDF, released under a MIT license.
# See the file LICENSE included with this distribution
__author__ = "Dan Cutright"
__version__ = "0.3.0"
__release__... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
4808,
9641,
13,
9078,
198,
37811,
27813,
37588,
329,
18248,
23127,
12,
20456,
526,
15931,
198,
2,
15069,
357,
66,
... | 2.82906 | 117 |
import torch
import numpy as np
from training.networks import FullyConnectedLayer
batch_size = 2
in_channels = 512
w_dim = 512
lr = 0.1
# activation = 'linear'
# activation = 'lrelu'
# activation = 'relu'
# activation = 'tanh'
activation = 'sigmoid'
# activation = 'elu'
# activation = 'selu'
# activation = 'softplus... | [
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
3047,
13,
3262,
5225,
1330,
40234,
13313,
276,
49925,
628,
198,
43501,
62,
7857,
796,
362,
198,
259,
62,
354,
8961,
796,
22243,
198,
86,
62,
27740,
796,
22243,
198,
140... | 2.479924 | 523 |
from appJar import gui
import paho.mqtt.client as mqtt
import sys
# sys.path.insert(0, '/home/nikolatz/Edge-Computing-Interpretation/mainNode')
# from main_node import runMain
app = gui()
app.setBg("DarkKhaki")
app.startPagedWindow("Welcome to projecto")
app.startPage()
app.addLabel("w1", "You have to choose two fil... | [
6738,
598,
47511,
1330,
11774,
198,
11748,
279,
17108,
13,
76,
80,
926,
13,
16366,
355,
285,
80,
926,
198,
11748,
25064,
198,
2,
25064,
13,
6978,
13,
28463,
7,
15,
11,
31051,
11195,
14,
17187,
349,
27906,
14,
37021,
12,
5377,
48074,... | 2.619512 | 410 |
# Generated by Django 2.2.13 on 2020-08-02 01:23
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1485,
319,
12131,
12,
2919,
12,
2999,
5534,
25,
1954,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
import utils
import numpy as np
from sklearn.multiclass import OneVsRestClassifier
from sklearn.model_selection import KFold, cross_val_score
from sklearn.linear_model import SGDClassifier,LogisticRegression
# CROSS-VALIDATION ACCURACY
# TRAINING ACCURACY AND PREDICTION
| [
11748,
3384,
4487,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
16680,
291,
31172,
1330,
1881,
23266,
19452,
9487,
7483,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
509,
37,
727,
11,
3272,
62,
2100,
62,
26675,... | 3.209302 | 86 |
from Local import * | [
6738,
10714,
1330,
1635
] | 4.75 | 4 |
from PyQt5.QtWidgets import QWidget, QLabel, QGridLayout
from PyQt5.QtCore import Qt, pyqtSlot
import numpy as np
from PyQt5.QtGui import QPixmap, QImage
import os
| [
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
1195,
38300,
11,
1195,
33986,
11,
1195,
41339,
32517,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
33734,
11,
12972,
39568,
38963,
198,
11748,
299,
32152,
355,
45941... | 2.477612 | 67 |
class Solution:
"""
@param A: An integer array
@return: An integer
""" | [
4871,
28186,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2488,
17143,
317,
25,
1052,
18253,
7177,
198,
220,
220,
220,
2488,
7783,
25,
1052,
18253,
198,
220,
220,
220,
37227
] | 2.606061 | 33 |
"""
Copyright (C) 2018 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
"""
from __future__ import division
import torch.nn as nn
import scipy.misc
import numpy as np
import scipy.sparse
import scipy.sparse.linalg
from ... | [
37811,
198,
15269,
357,
34,
8,
2864,
15127,
10501,
13,
220,
220,
220,
1439,
2489,
10395,
13,
198,
26656,
15385,
739,
262,
12624,
11050,
12,
7792,
12,
4090,
604,
13,
15,
5964,
357,
5450,
1378,
20123,
425,
9503,
684,
13,
2398,
14,
677... | 3.014354 | 209 |
from models.player import Player, Roles, States as PlayerStates
| [
198,
6738,
4981,
13,
7829,
1330,
7853,
11,
371,
4316,
11,
1829,
355,
7853,
42237,
628,
198
] | 3.941176 | 17 |
import warnings
import numpy as np
import scipy.linalg as linalg
from scipy import sparse
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.preprocessing import normalize
from sklearn.utils import check_array, check_X_y
from sklearn.utils.validation import check_is_fitted
from .slices import slic... | [
11748,
14601,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
75,
1292,
70,
355,
300,
1292,
70,
198,
198,
6738,
629,
541,
88,
1330,
29877,
198,
6738,
1341,
35720,
13,
8692,
1330,
7308,
22362,
320,
1352,
11,
36... | 2.432925 | 3,183 |
# coding: utf-8
import os
import re
import sys
import ConfigParser
from util.live import Live
from util.google import Google
CONFIG_PATH = os.path.dirname(os.path.abspath(__file__)) + '/config'
CONFIG_SAMPLE_FILE = CONFIG_PATH + '.sample'
LIVE_BASE_URL = 'http://live.nicovideo.jp/watch/'
if __name__ == '__main__':... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
25064,
198,
11748,
17056,
46677,
198,
6738,
7736,
13,
12583,
1330,
7547,
198,
6738,
7736,
13,
13297,
1330,
3012,
198,
198,
10943,
16254,
62,
34219,
7... | 2.300813 | 246 |
from io import StringIO, SEEK_END
from pathlib import Path
from typing import Iterator, TextIO
from .input import Input
| [
6738,
33245,
1330,
10903,
9399,
11,
31107,
42,
62,
10619,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
40806,
1352,
11,
8255,
9399,
198,
198,
6738,
764,
15414,
1330,
23412,
628,
198
] | 3.617647 | 34 |
ALLOWED_HOSTS = ['*']
BROKER_URL = 'redis://127.0.0.1:6379/0'
CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379/0'
| [
7036,
3913,
1961,
62,
39,
10892,
50,
796,
37250,
9,
20520,
198,
198,
11473,
11380,
1137,
62,
21886,
796,
705,
445,
271,
1378,
16799,
13,
15,
13,
15,
13,
16,
25,
21,
29088,
14,
15,
6,
198,
34,
3698,
19664,
62,
19535,
16724,
62,
3... | 1.753846 | 65 |
from time import time
from functools import reduce
from operator import add
| [
6738,
640,
1330,
640,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
6738,
10088,
1330,
751,
198
] | 4.470588 | 17 |
# Derek Santos
from imgur import Imgur
from pprint import pformat
from time import sleep
import json
import logs
import os
import re
import requests
import shutil
log = logs.Log('downloader')
| [
2,
20893,
28458,
198,
6738,
33705,
333,
1330,
1846,
45073,
198,
6738,
279,
4798,
1330,
279,
18982,
198,
6738,
640,
1330,
3993,
198,
11748,
33918,
198,
11748,
17259,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
7007,
198,
11748,
4423,
... | 3.62963 | 54 |
import pandas as pd
import numpy as np
data = {
'Id': [1, 2, 3, 4, 5],
'Name': ['Syed', 'Shah', 'Sunil', 'Sherif', 'Sugata'],
'Score': [100, 200, 250, 350, 275]
}
df = pd.DataFrame(
data, index=['Rank 1', 'Rank 2', 'Rank 3', 'Rank 4', 'Rank 5'])
df["Locations"] = np.array(
['Bangalore', 'New York'... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
7890,
796,
1391,
198,
220,
220,
220,
705,
7390,
10354,
685,
16,
11,
362,
11,
513,
11,
604,
11,
642,
4357,
198,
220,
220,
220,
705,
5376,
10354,
37250,
13940,
... | 2.213873 | 173 |
import cv2
import numpy as np
from Functions.Featurespace import find_annodir
from Functions import imgproc_func as imf
import glob
# TODO: FIX FS thresholding, GR detection
"""
SÆT DIN PATH TIL DIT ONE DRIVE HER -> DOWNLOAD ANNOTATIONS MAPPEN FØRST
"""
# Path to folder containing the different classes
path = r'C:\Us... | [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
40480,
13,
23595,
10223,
1330,
1064,
62,
1236,
375,
343,
198,
6738,
40480,
1330,
33705,
36942,
62,
20786,
355,
545,
69,
198,
11748,
15095,
198,
198,
2,
16926,
46,
25,
... | 1.965771 | 3,535 |
import numpy as np
from loguru import logger
from scipy import ndimage
from skimage import img_as_ubyte, img_as_float
from skimage import io
from qtpy.QtWidgets import QRadioButton, QPushButton
from qtpy import QtWidgets, QtCore, QtGui
from survos2.frontend.components.base import *
from survos2.frontend.control impo... | [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
2604,
14717,
1330,
49706,
198,
6738,
629,
541,
88,
1330,
299,
67,
9060,
198,
6738,
1341,
9060,
1330,
33705,
62,
292,
62,
549,
88,
660,
11,
33705,
62,
292,
62,
22468,
198,
6738,
1341,
90... | 3.008 | 125 |
#!/usr/bin/env python3.8
from argparse import ArgumentParser
import os, pgen
from cacti import cacti
from cacti.cacti_interface_pb2 import CactiInput
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
13,
23,
198,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
11748,
28686,
11,
279,
5235,
198,
6738,
269,
529,
72,
1330,
269,
529,
72,
198,
6738,
269,
529,
72,
13,
66,
529,
72,
62,... | 2.638889 | 72 |
fizzbuzz()
| [
198,
69,
6457,
65,
4715,
3419,
198
] | 1.714286 | 7 |
import torch
from torch import nn, optim, ones, randn, zeros, cat
from generator import Generator
from discriminator import Discriminator
from prep import train_loader, batch_size
import matplotlib.pyplot as plt
# Setting learning rate, number of epochs and loss function
lr = 0.001
n_epochs = 300
loss_function = nn.B... | [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
11,
6436,
11,
3392,
11,
43720,
77,
11,
1976,
27498,
11,
3797,
198,
6738,
17301,
1330,
35986,
198,
6738,
6534,
20900,
1330,
8444,
3036,
20900,
198,
6738,
3143,
1330,
4512,
62,
29356,
11,
1... | 2.601841 | 869 |
#!/usr/bin/env python3
import os, sys, traceback
import signal
import asyncio
from asyncio.subprocess import create_subprocess_exec, PIPE
import aiohttp
from service import load_config, run as service
server_proc = None
server_cmd = os.path.join(os.path.dirname(__file__), 'server.sh')
server_name = 'twofishes'
s... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
28686,
11,
25064,
11,
12854,
1891,
198,
11748,
6737,
198,
198,
11748,
30351,
952,
198,
6738,
30351,
952,
13,
7266,
14681,
1330,
2251,
62,
7266,
14681,
62,
18558,
11,
35... | 2.763285 | 414 |
'''
I2C LCD1602 demo
Author: shaoziyang
Date: 2018.2
http://www.micropython.org.cn
'''
from machine import I2C
import time
l = LCD1620(I2C(1))
l.puts("Hello microbit!")
n = 0
while 1:
l.puts(str(n), 0, 1)
n = n + 1
time.sleep_ms(1000)
| [
7061,
6,
198,
220,
220,
220,
314,
17,
34,
23598,
1433,
2999,
13605,
628,
220,
220,
220,
6434,
25,
427,
5488,
89,
7745,
648,
198,
220,
220,
220,
7536,
25,
220,
220,
2864,
13,
17,
628,
220,
220,
220,
2638,
1378,
2503,
13,
9383,
17... | 1.985294 | 136 |
"""各種pythonファイルをコマンドラインから利用するためのCLIツール
See Also:
- `typer`_
.. _typer: https://qiita.com/iisaka51/items/18bde4dada0827fbe81e
Example:
ヘルプ
>>> `python cli.py --help`
サブコマンドのヘルプ
>>> `python cli.py [command] --help`
Attention:
_は-で実行する
"""
from typing import Optional
import typer
from... | [
37811,
28938,
226,
163,
101,
106,
29412,
41939,
11482,
9202,
31758,
24679,
20115,
6527,
19073,
11482,
6527,
27370,
36853,
26344,
102,
18796,
101,
33623,
25748,
25224,
1792,
223,
5641,
5097,
40,
41115,
43353,
198,
198,
6214,
4418,
25,
198,
... | 2.071429 | 364 |
'''Defines a pipeline step which aquires data from the pig data source.
'''
import os
from src import datasets
from src.step import Step
class GetPigData(Step):
'''Defines a pipeline step which aquires data from the pig data source.
'''
def __init__(self):
'''Initializes a new instance of the ... | [
7061,
6,
7469,
1127,
257,
11523,
2239,
543,
14839,
2387,
1366,
422,
262,
12967,
1366,
2723,
13,
198,
198,
7061,
6,
198,
198,
11748,
28686,
198,
198,
6738,
12351,
1330,
40522,
198,
6738,
12351,
13,
9662,
1330,
5012,
198,
198,
4871,
349... | 2.164619 | 407 |
from flask import render_template, session, redirect, url_for, Flask, request, flash, jsonify
from numpy.core.multiarray import ndarray
from . import rqalpha
import os
from multiprocessing import Process
import sys
sys.path.insert(0, "Z:\Hello\Work\Data\QT")
from rqalpha import run_code
from .. import db
from ..models... | [
6738,
42903,
1330,
8543,
62,
28243,
11,
6246,
11,
18941,
11,
19016,
62,
1640,
11,
46947,
11,
2581,
11,
7644,
11,
33918,
1958,
198,
6738,
299,
32152,
13,
7295,
13,
16680,
12571,
2433,
1330,
299,
67,
18747,
198,
198,
6738,
764,
1330,
... | 3.091633 | 251 |
"""Resource module for live view."""
import logging
from aiohttp import web
import aiohttp_jinja2
from sprint_webserver.services import (
DeltakereService,
InnstillingerService,
KjoreplanService,
KlasserService,
ResultatHeatService,
StartListeService,
)
class Live(web.View):
"""Class rep... | [
37811,
26198,
8265,
329,
2107,
1570,
526,
15931,
198,
11748,
18931,
198,
198,
6738,
257,
952,
4023,
1330,
3992,
198,
11748,
257,
952,
4023,
62,
18594,
6592,
17,
198,
198,
6738,
18553,
62,
732,
1443,
18497,
13,
30416,
1330,
357,
198,
2... | 1.888134 | 2,208 |
"""DropNAS searching"""
from torch import device
import torch.nn as nn
import xnas.core.config as config
import xnas.logger.logging as logging
import xnas.logger.meter as meter
from xnas.core.config import cfg
from xnas.core.builder import *
# DropNAS
from xnas.algorithms.DropNAS import *
from xnas.runner.trainer im... | [
37811,
26932,
18293,
10342,
37811,
198,
198,
6738,
28034,
1330,
3335,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
198,
11748,
2124,
24716,
13,
7295,
13,
11250,
355,
4566,
198,
11748,
2124,
24716,
13,
6404,
1362,
13,
6404,
2667,
355... | 2.972973 | 222 |
#!/usr/bin/python
import json
from ansible.module_utils.basic import *
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
33918,
628,
628,
628,
198,
6738,
9093,
856,
13,
21412,
62,
26791,
13,
35487,
1330,
1635,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
... | 2.636364 | 44 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
@ Author : pengj
@ date : 2019/10/22 11:00
@ IDE : PyCharm
@ GitHub : https://github.com/JackyPJB
@ Contact : pengjianbiao@hotmail.com
---------------... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
47232,
12,
628,
220,
220,
220,
2488,
220,
220,
6434,
220,
1058,
220,
220,
220,
220,
220,
220,
279,
1516,
... | 2.313167 | 281 |
class DoublyLinkedList:
"""
Time Complexity:
Insertion = O(1)
Removal = O(1)
Searching = O(N)
Access = O(N)
Most of the logic is the same as the SLL except dealing with the extra prev point
"""
def push(self,val):
"""
Adds a new Node at the end... | [
198,
4871,
5728,
36874,
11280,
276,
8053,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3862,
19157,
414,
25,
220,
198,
220,
220,
220,
220,
220,
220,
220,
35835,
295,
796,
440,
7,
16,
8,
198,
220,
220,
220,
220,
220,
220,
2... | 1.923186 | 2,122 |
import tushare as ts
import time
start = time.time()
df = ts.pro_bar(ts_code='300851.SZ', adj='qfq', start_date='20200714', end_date='20200716')
t0 = time.time() - start
print(t0)
print(df)
arr = df.to_records()
start = time.time()
df = ts.get_k_data("603488", start='2020-07-14', end='2020-07-16', index=False, ktype=... | [
11748,
256,
1530,
533,
355,
40379,
198,
11748,
640,
198,
198,
9688,
796,
640,
13,
2435,
3419,
198,
7568,
796,
40379,
13,
1676,
62,
5657,
7,
912,
62,
8189,
11639,
6200,
23,
4349,
13,
50,
57,
3256,
9224,
11639,
80,
69,
80,
3256,
923... | 2.291667 | 168 |