content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import os
from setuptools import Extension, setup
from Cython.Build import cythonize
DESTDIR = os.environ.get("DESTDIR")
if DESTDIR:
ext_modules = [
Extension("baresip",
sources=["python_binding/baresip_binding.pyx"],
libraries=["dssipapp","baresip"], # Unix-like specific
... | [
11748,
28686,
198,
6738,
900,
37623,
10141,
1330,
27995,
11,
9058,
198,
6738,
327,
7535,
13,
15580,
1330,
3075,
400,
261,
1096,
198,
198,
35,
6465,
34720,
796,
28686,
13,
268,
2268,
13,
1136,
7203,
35,
6465,
34720,
4943,
198,
361,
360... | 2.036281 | 441 |
## Python Portion fetching data from Database
## (End result is coordination with mobile app and other platforms)
## By Adrit Rao
# Import Firebase Library
import pyrebase
config = {
"apiKey": "apiKey",
"authDomain": "projectId.firebaseapp.com",
"databaseURL": "https://databaseName.firebaseio.com",
"s... | [
2235,
11361,
4347,
295,
21207,
278,
1366,
422,
24047,
198,
2235,
357,
12915,
1255,
318,
19877,
351,
5175,
598,
290,
584,
9554,
8,
198,
2235,
2750,
1215,
799,
48395,
198,
198,
2,
17267,
3764,
8692,
10074,
198,
11748,
12972,
260,
8692,
... | 2.814655 | 232 |
import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
l1tRct = DQMEDAnalyzer('L1TRCT',
DQMStore = cms.untracked.bool(True),
HistFolder = cms.untracked.string('L1T/L1TRCT'),
rctSource = cms.InputTag("gctDigis"),
verbose = cms.untracked.bool(False),
filterT... | [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
6738,
360,
48,
5653,
712,
1063,
13,
14055,
13,
35,
48,
30733,
37702,
9107,
1330,
360,
48,
30733,
37702,
9107,
198,
75,
16,
83,
49,
310,
796,
360,
48,
30733,
... | 2.25 | 172 |
#!/usr/bin/env python
"""Setup CloudWanderer package."""
import re
from os import path
from setuptools import find_packages, setup
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.rst"), encoding="utf-8") as f:
long_description = re.sub(r"..\s+doctest\s+::", ".. co... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
40786,
10130,
54,
392,
11882,
5301,
526,
15931,
198,
11748,
302,
198,
6738,
28686,
1330,
3108,
198,
198,
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
11,
9058,
198,
198,
5661,
... | 2.771588 | 359 |
import os
import pandas as pd
from aif360.datasets import StandardDataset
default_mappings = {
'label_maps': [{0.0: 'Did recid.', 1.0: 'No recid.'}],
'protected_attribute_maps': [{1.0: 'Other', 0.0: 'African-American'}]
}
class CompasDataset(StandardDataset):
"""ProPublica COMPAS Dataset.
See :fil... | [
11748,
28686,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
257,
361,
15277,
13,
19608,
292,
1039,
1330,
8997,
27354,
292,
316,
628,
198,
12286,
62,
76,
39242,
796,
1391,
198,
220,
220,
220,
705,
18242,
62,
31803,
10354,
... | 2.33121 | 157 |
'''
Constructing task automaton and abstract reachability graph from spec.
'''
from copy import copy
from spectrl.main.spec_compiler import Cons, land
from spectrl.hierarchy.reachability import AbstractEdge, AbstractReachability
class TaskAutomaton:
'''
Task Automaton without registers.
Parameters:
... | [
7061,
6,
198,
42316,
278,
4876,
3557,
13951,
290,
12531,
3151,
1799,
4823,
422,
1020,
13,
198,
7061,
6,
198,
6738,
4866,
1330,
4866,
198,
6738,
5444,
45895,
13,
12417,
13,
16684,
62,
5589,
5329,
1330,
3515,
11,
1956,
198,
6738,
5444,
... | 2.207413 | 2,671 |
print(apply_twice(add_five,10)) | [
198,
4798,
7,
39014,
62,
4246,
501,
7,
2860,
62,
13261,
11,
940,
4008
] | 2.285714 | 14 |
# Faça um Programa que peça 2 números inteiros e um número real. Calcule e mostre:
# o produto do dobro do primeiro com metade do segundo .
# a soma do triplo do primeiro com o terceiro.
# o terceiro elevado ao cubo.
inteiro1 = int(input("Digite um número inteiro: "))
inteiro2 = int(input("Digite outro número in... | [
2,
18350,
50041,
23781,
6118,
64,
8358,
613,
50041,
362,
299,
21356,
647,
418,
493,
20295,
4951,
304,
23781,
299,
21356,
647,
78,
1103,
13,
2199,
23172,
304,
749,
260,
25,
201,
198,
2,
267,
40426,
9390,
466,
466,
7957,
466,
6994,
70... | 2.285068 | 221 |
# -*- coding: utf-8 -*-
########
# Copyright (c) 2016-2020 Cloudify Platform Ltd. 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... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7804,
198,
2,
15069,
357,
66,
8,
1584,
12,
42334,
10130,
1958,
19193,
12052,
13,
1439,
2489,
10395,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
... | 3.377289 | 273 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
24118,
687,
10290,
357,
27110,
5235,
8,
16984,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760... | 3.382114 | 123 |
# Generated by Django 2.2.8 on 2020-01-17 19:54
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
23,
319,
12131,
12,
486,
12,
1558,
678,
25,
4051,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
from handlers.threads.CreateCFLThread import CreateCFLThread
from handlers.threads.ExtactCFLThread import ExtractCFLThread
__author__ = 'Toyz'
import os
import sys
from PyQt4.QtGui import *
from PyQt4 import QtCore, QtGui, uic
from handlers.cfl.CFLOpener import CFLOpener
from handlers.chkn.ChknFile import ChknFile
fr... | [
6738,
32847,
13,
16663,
82,
13,
16447,
34,
3697,
16818,
1330,
13610,
34,
3697,
16818,
198,
6738,
32847,
13,
16663,
82,
13,
11627,
529,
34,
3697,
16818,
1330,
29677,
34,
3697,
16818,
198,
198,
834,
9800,
834,
796,
705,
48236,
89,
6,
... | 2.831683 | 303 |
# Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
2,
15069,
13130,
43208,
21852,
1766,
1539,
12052,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198... | 3.132701 | 422 |
from __future__ import print_function
from os import path
from os.path import dirname
from sys import stderr
from typing import Dict, Optional, List
def fill_boilerplate(
dependency_arguments,
): # type: (Dict[str, List[str]]) -> Optional[str]
"""
read boilerplate setup.py file, fill dependency_links an... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
6738,
28686,
1330,
3108,
198,
6738,
28686,
13,
6978,
1330,
26672,
3672,
198,
6738,
25064,
1330,
336,
1082,
81,
198,
6738,
19720,
1330,
360,
713,
11,
32233,
11,
7343,
628,
198,
4... | 2.542094 | 487 |
from gym.envs.registration import register
register(
id='vizdoom-v0',
entry_point='gym_vizdoom.envs:VizdoomEnv',
)
| [
6738,
11550,
13,
268,
14259,
13,
2301,
33397,
1330,
7881,
198,
198,
30238,
7,
198,
220,
4686,
11639,
85,
528,
67,
4207,
12,
85,
15,
3256,
198,
220,
5726,
62,
4122,
11639,
1360,
76,
62,
85,
528,
67,
4207,
13,
268,
14259,
25,
53,
... | 2.264151 | 53 |
import time
import sys
import struct
import os
import gzip
import functools32
import numpy as np
import numpy.ma as ma
import datetime
from optparse import OptionParser
from obspy.core import Trace, Stream, UTCDateTime
import obspy.signal.filter
from sigvisa.database.dataset import *
from sigvisa.signals.common impor... | [
11748,
640,
198,
11748,
25064,
198,
11748,
2878,
198,
11748,
28686,
198,
11748,
308,
13344,
198,
11748,
1257,
310,
10141,
2624,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
299,
32152,
13,
2611,
355,
17266,
198,
11748,
4818,
8079,
198,... | 2.371262 | 4,983 |
from glob import glob
import numpy as np
import torch
from torch.utils.data import DataLoader, Dataset
def getImage(dataset_path):
'''
获取当前目录下的所有pic_type格式的图片
'''
pics = sorted(glob(dataset_path+'/*.npy'))
pic_data = []
pic_name = []
length_path = len(
dataset_path)+1 if pics[0][l... | [
6738,
15095,
1330,
15095,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
11,
16092,
292,
316,
628,
198,
4299,
651,
5159,
7,
19608,
292,
316,
62,
6978,
2599,
198,
2... | 1.931217 | 567 |
"""Test cases for objective metrics."""
import math
import muspy
from muspy import (
drum_in_pattern_rate,
drum_pattern_consistency,
empty_beat_rate,
empty_measure_rate,
groove_consistency,
n_pitch_classes_used,
n_pitches_used,
pitch_class_entropy,
pitch_entropy,
pitch_in_scale_... | [
37811,
14402,
2663,
329,
9432,
20731,
526,
15931,
198,
11748,
10688,
198,
198,
11748,
1928,
9078,
198,
6738,
1928,
9078,
1330,
357,
198,
220,
220,
220,
13026,
62,
259,
62,
33279,
62,
4873,
11,
198,
220,
220,
220,
13026,
62,
33279,
62,... | 2.404255 | 188 |
"""
End-to-end tests for the person detail view
"""
import re
from unittest import mock
from django.test.utils import override_settings
import htmlmin
from cms.api import add_plugin
from cms.test_utils.testcases import CMSTestCase
from richie.apps.core.factories import PageFactory, UserFactory
from richie.apps.cours... | [
37811,
198,
12915,
12,
1462,
12,
437,
5254,
329,
262,
1048,
3703,
1570,
198,
37811,
198,
11748,
302,
198,
6738,
555,
715,
395,
1330,
15290,
198,
198,
6738,
42625,
14208,
13,
9288,
13,
26791,
1330,
20957,
62,
33692,
198,
198,
11748,
27... | 2.329373 | 10,605 |
from .enviaremail import EnviarEmail
from .conceitos import IAList | [
6738,
764,
268,
8903,
533,
4529,
1330,
2039,
8903,
283,
15333,
198,
6738,
764,
1102,
344,
270,
418,
1330,
314,
1847,
396
] | 3 | 22 |
from .about import AboutCommand
from .add import AddCommand
from .build import BuildCommand
from .check import CheckCommand
from .config import ConfigCommand
from .develop import DevelopCommand
from .export import ExportCommand
from .init import InitCommand
from .install import InstallCommand
from .lock import LockComm... | [
6738,
764,
10755,
1330,
7994,
21575,
198,
6738,
764,
2860,
1330,
3060,
21575,
198,
6738,
764,
11249,
1330,
10934,
21575,
198,
6738,
764,
9122,
1330,
6822,
21575,
198,
6738,
764,
11250,
1330,
17056,
21575,
198,
6738,
764,
16244,
1330,
6013... | 4.577465 | 142 |
import select
from sys import version_info
from ceptic.common import CepticException
class SocketCepticException(CepticException):
"""
General SocketCeptic Exception, inherits from CepticException
"""
pass
if version_info < (3, 0):
# Python 2
import socket
class SocketCeptic(object):
... | [
11748,
2922,
198,
6738,
25064,
1330,
2196,
62,
10951,
198,
198,
6738,
2906,
17459,
13,
11321,
1330,
20101,
17459,
16922,
628,
198,
4871,
47068,
34,
68,
17459,
16922,
7,
34,
68,
17459,
16922,
2599,
198,
220,
220,
220,
37227,
198,
220,
... | 2.079195 | 3,927 |
from django.db import models
from django.contrib.auth.models import User
User.add_to_class("__str__", get_full_name)
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
628,
198,
198,
12982,
13,
2860,
62,
1462,
62,
4871,
7203,
834,
2536,
834,
1600,
651,
62,
12853,
62,
3672,
8,
628,
6... | 2.860465 | 43 |
# -*- coding: utf-8 -*-
import logging
from vindauga.constants.buttons import bfDefault
from vindauga.constants.command_codes import hcNoContext, cmOK
from vindauga.constants.event_codes import evCommand
from vindauga.constants.keys import kbAltA
from vindauga.constants.option_flags import ofCentered
from vindauga.me... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
18931,
198,
198,
6738,
29178,
44718,
13,
9979,
1187,
13,
4360,
27288,
1330,
275,
69,
19463,
198,
6738,
29178,
44718,
13,
9979,
1187,
13,
21812,
62,
40148,
1330,
2... | 0.735767 | 12,243 |
import re
| [
11748,
302,
198
] | 3.333333 | 3 |
import pandas as pd
import numpy as np
from math import log
from sklearn import metrics
__author__ = 'ashanbhag3'
if __name__ == '__main__':
# Data preprossing
x_train = pd.read_csv("../data/train.csv")
x_test = pd.read_csv("../data/test.csv")
y_train = load_list_readable("../da... | [
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
10688,
1330,
2604,
201,
198,
6738,
1341,
35720,
1330,
20731,
201,
198,
201,
198,
834,
9800,
834,
796,
705,
1077,
272,
34369,
363,
18,
6,
201,
... | 2.036545 | 602 |
from tridesclous import *
from tridesclous.tools import download_probe
import pyqtgraph as pg
if __name__ == '__main__':
test_ProbeGeometryView()
| [
6738,
491,
1460,
565,
516,
1330,
1635,
198,
6738,
491,
1460,
565,
516,
13,
31391,
1330,
4321,
62,
1676,
1350,
198,
11748,
220,
12972,
80,
25297,
1470,
355,
23241,
628,
628,
220,
220,
220,
220,
198,
220,
220,
220,
220,
628,
198,
361,... | 2.553846 | 65 |
from cpt.packager import ConanMultiPackager
if __name__ == "__main__":
test_build()
builder = ConanMultiPackager(channel="stable", docker_32_images=True)
builder.add_common_builds(shared_option_name="asynqro:shared", pure_c=False)
builder.run()
| [
6738,
269,
457,
13,
8002,
3536,
1330,
31634,
29800,
11869,
3536,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1332,
62,
11249,
3419,
198,
220,
220,
220,
27098,
796,
31634,
29800,
11869,
3536,
... | 2.757895 | 95 |
import pygame, image_loader, sprite
pygame.init()
screen = pygame.display.set_mode((500,200))
clock = pygame.time.Clock()
fps = 60
#Dictionary of images
scale_factor = 4 #4x larger
images = image_loader.getImageDictionary(scale_factor)
w_idle = 'wizzard_m_idle_anim_f'
w_idle_num = 4
frames = []
for i in range(w_idl... | [
11748,
12972,
6057,
11,
2939,
62,
29356,
11,
33810,
198,
198,
9078,
6057,
13,
15003,
3419,
198,
198,
9612,
796,
12972,
6057,
13,
13812,
13,
2617,
62,
14171,
19510,
4059,
11,
2167,
4008,
198,
15750,
796,
12972,
6057,
13,
2435,
13,
4475... | 2.440092 | 434 |
import pandas as pd
from data.process_data.process_data import process_data
OPTION = 'buy' # buy | click
TAO_BAO_PATH = 'data/taobao/taobao15.csv'
if OPTION == 'buy':
TAO_BAO_OUTPUT = 'taobao_buy'
TAO_BAO_ACT_ID = 1
else:
TAO_BAO_OUTPUT = 'taobao_click'
TAO_BAO_ACT_ID = 0
TAO_BAO_USER_COL = 'use_ID'
... | [
11748,
19798,
292,
355,
279,
67,
198,
6738,
1366,
13,
14681,
62,
7890,
13,
14681,
62,
7890,
1330,
1429,
62,
7890,
198,
198,
3185,
24131,
796,
705,
17846,
6,
220,
1303,
2822,
930,
3904,
198,
198,
5603,
46,
62,
4339,
46,
62,
34219,
... | 1.888554 | 332 |
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import shutil
import tempfile
from telemetry import decorators
from telemetry.testing import options_for_unittests
from telemetry.testing import p... | [
2,
15069,
2177,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
198,
11748... | 3.837838 | 111 |
import math
import time
import latexify
import keyboard
import pyautogui
import pyperclip
@latexify.with_latex
if __name__ == '__main__':
#keyboard.add_hotkey('ctrl+`',insertFormular,args=(0.5,))
#keyboard.wait()
insertFormular(0.5) | [
11748,
10688,
198,
11748,
640,
198,
11748,
47038,
1958,
198,
11748,
10586,
198,
11748,
12972,
2306,
519,
9019,
198,
11748,
12972,
525,
15036,
198,
198,
31,
17660,
87,
1958,
13,
4480,
62,
17660,
87,
198,
198,
361,
11593,
3672,
834,
6624,... | 2.633333 | 90 |
# -*- coding: utf-8 -*-
from unittest.mock import patch
import pytest
import bildungslogin_plugin.plugin
from bildungslogin_plugin.backend_udm_rest_api import UdmRestApiBackend
from bildungslogin_plugin.routes.v1.users import get_backend
@patch("bildungslogin_plugin.plugin.ldap_auth")
@pytest.mark.asyncio
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
11748,
12972,
9288,
198,
198,
11748,
275,
688,
2150,
82,
38235,
62,
33803,
13,
33803,
198,
6738,
275,
688,... | 2.557377 | 122 |
import numpy as np
import matplotlib.pyplot as plt
#plotting gaussian
x=np.linspace(-5,5, num=100)
y=np.linspace(-5,5, num=100)
x, y = np.meshgrid(x, y)
z = -np.exp(-0.2*x**2-0.2*y**2)/4
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(x,y,z, cmap="winter")
ax.set_axis_off()
#plot... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
220,
198,
2,
29487,
889,
31986,
31562,
198,
87,
28,
37659,
13,
21602,
10223,
32590,
20,
11,
20,
11,
997,
28,
3064,
8,
198,
88,
28,
3... | 1.931271 | 291 |
########################################################
# DO NOT EDIT THE CODE IN THE SECTION BELOW
########################################################
import sys
numbers = sys.argv[1:]
for i in range(len(numbers)):
numbers[i] = int(numbers[i])
########################################################
# Enter ... | [
29113,
14468,
7804,
198,
2,
8410,
5626,
48483,
3336,
42714,
3268,
3336,
44513,
45339,
198,
29113,
14468,
7804,
198,
11748,
25064,
198,
198,
77,
17024,
796,
25064,
13,
853,
85,
58,
16,
47715,
198,
1640,
1312,
287,
2837,
7,
11925,
7,
77... | 5.197368 | 76 |
# -*- coding: utf-8 -*-
"""Tests around :py:mod:`transmutator.cli`."""
from StringIO import StringIO
import sys
import unittest
import transmutator
from transmutator import cli
class TransmuteTestCase(unittest.TestCase):
"""Tests around :py:func:`transmutator.cli.transmute`."""
def transmute(self, args=[]):... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
51,
3558,
1088,
1058,
9078,
25,
4666,
25,
63,
7645,
21973,
1352,
13,
44506,
63,
526,
15931,
198,
6738,
10903,
9399,
1330,
10903,
9399,
198,
11748,
25064,
198,
117... | 2.396122 | 361 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import numpy as np
x_size,y_size = 1024,512
# actual map size
x_size -= 2
y_size -= 2
with open("coordinates.json",'r') as f:
raw_city_data = json.load(f)
with open("centering.txt",'r',newline='\n') as f:
city1_line = f.readline()
city2_line = f... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
33918,
198,
11748,
299,
32152,
355,
45941,
198,
198,
87,
62,
7857,
11,
88,
62,
7857,
796,
28119,
11,
25836... | 2.197576 | 825 |
#import all that is needed
import numpy as np
np.random.seed(7)
from tensorflow import set_random_seed
set_random_seed(7)
import pandas as pd
import keras
from keras import backend as K
from keras.layers import Dense, Flatten, Dropout
from keras.models import Sequential
from keras.preprocessing.image import ImageDataGe... | [
2,
11748,
477,
326,
318,
2622,
198,
11748,
299,
32152,
355,
45941,
198,
37659,
13,
25120,
13,
28826,
7,
22,
8,
198,
6738,
11192,
273,
11125,
1330,
900,
62,
25120,
62,
28826,
198,
2617,
62,
25120,
62,
28826,
7,
22,
8,
198,
11748,
1... | 2.777593 | 1,205 |
# import pandas as pd
import time
import site
import sys
sys.path.append("c:\\users\\lakit\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\")
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
from collections import OrderedDict
from mintsXU4 import mintsL... | [
2,
1330,
19798,
292,
355,
279,
67,
198,
11748,
640,
220,
198,
11748,
2524,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7203,
66,
25,
6852,
18417,
6852,
75,
461,
270,
6852,
1324,
7890,
6852,
12001,
6852,
23065,
82,
6852,
29412,... | 2.704819 | 498 |
# Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... | [
2,
220,
220,
220,
220,
15069,
1584,
12,
25579,
327,
28778,
784,
3427,
12275,
329,
19229,
4992,
198,
2,
198,
2,
220,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
2... | 3.036344 | 908 |
from netCDF4 import Dataset
import numpy as np
import pandas as pd
import canyon_tools.readout_tools as rout
#from MITgcmutils import rdmds # cant make it work
CGrid = '/data/kramosmu/results/TracerExperiments/3DVISC_REALISTIC/run01/gridGlob.nc' # Smallest volume grid, closed bdy, no canyon.
CGridOut = Dataset(CGrid)
... | [
6738,
2010,
34,
8068,
19,
1330,
16092,
292,
316,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
42775,
62,
31391,
13,
961,
448,
62,
31391,
355,
3441,
198,
2,
6738,
17168,
70,
11215,
26791,
1330,
... | 1.900108 | 2,783 |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.plugins import pluggable
__all__ = ['quadmesh_planarize']
@pluggable(category='quadmesh')
def quadmesh_planarize(M, kmax=500, maxdev=0.005):
"""Planarize the faces of a quad mesh.
Param... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
6738,
552,
292,
13,
37390,
1330,
6107,
70,
540,
628,
198,
834,
439,
834,
796,
3725... | 2.843636 | 275 |
import math
import os
import pickle
import random
from timeit import default_timer as timer
import numpy as np
from src.const import cache_path
from src.parser import parse_interactions, parse_tracks, parse_targets
def build_train_set_uniform(interactions, targets=None, p=0.15):
"""
Given the interactions m... | [
11748,
10688,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
4738,
198,
6738,
640,
270,
1330,
4277,
62,
45016,
355,
19781,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
12351,
13,
9979,
1330,
12940,
62,
6978,
198,
6738... | 2.526531 | 980 |
MAX = 0
KNOWN_TYPES = ['catcoin', 'dogcoin']
| [
22921,
796,
657,
198,
44706,
62,
9936,
47,
1546,
796,
37250,
9246,
3630,
3256,
705,
9703,
3630,
20520,
628,
628,
198
] | 2.333333 | 21 |
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="bobby-home",
version="0.4.0",
author="Maxime Moreau",
author_email="contact@maxime-moreau.fr",
description="Home security system with RaspberryPi's.",
long_descripti... | [
11748,
900,
37623,
10141,
628,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
1600,
21004,
2625,
40477,
12,
23,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
13,
961,
3419,
198,
198,
2617,
... | 2.597122 | 278 |
"""External dependencies.
Macros defined in this file should be called near the end of the WORKSPACE
file, once the workspace dependencies have been set up.
The go_dependencies() macro is automatically generated by running:
$ bazel run //:gazelle -- update-repos -from_file=go.mod
"""
load("@bazel_gazelle//:deps.bzl"... | [
37811,
41506,
20086,
13,
198,
198,
14155,
4951,
5447,
287,
428,
2393,
815,
307,
1444,
1474,
262,
886,
286,
262,
30936,
4303,
11598,
198,
7753,
11,
1752,
262,
44573,
20086,
423,
587,
900,
510,
13,
198,
198,
464,
467,
62,
45841,
3976,
... | 1.711209 | 3,390 |
"""Generate and evaluate random solutions
"""
import numpy as np
from ..data_loader.config_loader import ColocationConfig
from ..data_loader.matrix_loader import load_matrix
from ..core import corr_score
from ..core import calcs
def run(config: ColocationConfig):
"""Evaluating random solutions
Args:
... | [
37811,
8645,
378,
290,
13446,
4738,
8136,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
11485,
7890,
62,
29356,
13,
11250,
62,
29356,
1330,
1623,
5040,
16934,
198,
6738,
11485,
7890,
62,
29356,
13,
6759,
8609,
62,
29356,
13... | 2.403114 | 578 |
"""Test the PooledDB module.
Note:
We don't test performance here, so the test does not predicate
whether PooledDB actually will help in improving performance or not.
We also assume that the underlying SteadyDB connections are tested.
Copyright and credit info:
* This test was contributed by Christoph Zwerschke
"""
... | [
37811,
14402,
262,
19850,
276,
11012,
8265,
13,
198,
198,
6425,
25,
198,
1135,
836,
470,
1332,
2854,
994,
11,
523,
262,
1332,
857,
407,
44010,
198,
25356,
19850,
276,
11012,
1682,
481,
1037,
287,
10068,
2854,
393,
407,
13,
198,
1135,
... | 3.393548 | 155 |
import os.path as osp
import warnings
import mmcv
from mmcv.parallel import DataContainer as DC
import numpy as np
from torch.utils.data import Dataset
from pycocotools.coco import COCO
from mmcap.tokenizers import build_tokenizer
from .builder import DATASETS
from .pipelines import Compose
@DATASETS.register_modul... | [
11748,
28686,
13,
6978,
355,
267,
2777,
198,
11748,
14601,
198,
198,
11748,
8085,
33967,
198,
6738,
8085,
33967,
13,
1845,
29363,
1330,
6060,
29869,
355,
6257,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
28034,
13,
26791,
13,
7890,
1... | 2.163673 | 2,450 |
"""
Utilities for truncating assertion output.
Current default behaviour is to truncate assertion explanations at
~8 terminal lines, unless running in "-vv" mode or running on CI.
"""
from _pytest.assertion.util import _running_on_ci
DEFAULT_MAX_LINES = 8
DEFAULT_MAX_CHARS = 8 * 80
USAGE_MSG = "use '-vv' to show"
... | [
37811,
198,
18274,
2410,
329,
40122,
803,
19190,
5072,
13,
198,
198,
11297,
4277,
9172,
318,
284,
40122,
378,
19190,
18681,
379,
198,
93,
23,
12094,
3951,
11,
4556,
2491,
287,
27444,
25093,
1,
4235,
393,
2491,
319,
14514,
13,
198,
378... | 2.757506 | 866 |
from typing import Any, List, Union, Tuple
from os import name
from subprocess import call
from shutil import get_terminal_size
term_width: int = get_terminal_size()[0]
def clear_terminal() -> None:
"""Function clear terminal window"""
call('cls' if name == 'nt' else 'clear', shell=True)
def separator() ->... | [
6738,
19720,
1330,
4377,
11,
7343,
11,
4479,
11,
309,
29291,
198,
6738,
28686,
1330,
1438,
198,
6738,
850,
14681,
1330,
869,
198,
6738,
4423,
346,
1330,
651,
62,
23705,
282,
62,
7857,
198,
198,
4354,
62,
10394,
25,
493,
796,
651,
62... | 2.087477 | 2,675 |
#!/usr/bin/env python
import argparse
import json
import os
import random
basedir = (os.path.dirname(os.path.realpath(__file__)))
data_definitions_dir = os.path.join(basedir, 'data_definitions')
template = '''{
"datatype": {
"datatype": "EnumeratedDataType",
"name": "parking space",
"enum... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
1822,
29572,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
4738,
198,
198,
3106,
343,
796,
357,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
5305,
6978,
7,
8... | 2.22807 | 228 |
import copy
from . import cilast as cil
from . import coolast as ast
from . import visitor
from .scope import VariableInfo
from . import coolutils
from .context import Context
from pprint import pprint
| [
11748,
4866,
198,
198,
6738,
764,
1330,
269,
346,
459,
355,
269,
346,
198,
6738,
764,
1330,
3608,
459,
355,
6468,
198,
6738,
764,
1330,
21493,
198,
6738,
764,
29982,
1330,
35748,
12360,
198,
6738,
764,
1330,
3608,
26791,
198,
6738,
76... | 3.830189 | 53 |
import data_3_6
import data_3_7
import data_3_8
info_36 = data_3_6.info
info_37 = data_3_7.info
info_38 = data_3_8.info
print("<div>")
files = set([])
for filename in info_36:
try:
data_36 = info_36[filename]
data_37 = info_37[filename]
data_38 = info_38[filename]
except KeyError:
... | [
11748,
1366,
62,
18,
62,
21,
198,
11748,
1366,
62,
18,
62,
22,
198,
11748,
1366,
62,
18,
62,
23,
198,
198,
10951,
62,
2623,
796,
1366,
62,
18,
62,
21,
13,
10951,
198,
10951,
62,
2718,
796,
1366,
62,
18,
62,
22,
13,
10951,
198,... | 2.34878 | 410 |
import networkx as nx
import osmium as o
from osgeo import ogr
import argparse
def store_shp(rn, target_path):
''' nodes: [lng, lat] '''
rn.remove_nodes_from(list(nx.isolates(rn)))
print('# of nodes:{}'.format(rn.number_of_nodes()))
print('# of edges:{}'.format(rn.number_of_edges()))
for _, _, da... | [
11748,
3127,
87,
355,
299,
87,
198,
11748,
267,
5796,
1505,
355,
267,
198,
6738,
28686,
469,
78,
1330,
267,
2164,
198,
11748,
1822,
29572,
628,
198,
198,
4299,
3650,
62,
1477,
79,
7,
35906,
11,
2496,
62,
6978,
2599,
198,
220,
220,
... | 2.377574 | 437 |
square = [num * num for num in range(10)]
print(square)
# Various operation on list.
# Sum() : returns the sum of list.
sum_num = sum(square)
print(sum_num)
# min() : returns minimum number in list.
min_num = min(square)
print(min_num)
# max() : returns the maximum number in list.
max_num = max(square)
print(max_num... | [
23415,
796,
685,
22510,
1635,
997,
329,
997,
287,
2837,
7,
940,
15437,
198,
4798,
7,
23415,
8,
198,
198,
2,
26386,
4905,
319,
1351,
13,
198,
2,
5060,
3419,
1058,
5860,
262,
2160,
286,
1351,
13,
198,
16345,
62,
22510,
796,
2160,
7,... | 2.861244 | 209 |
countries = input().split(", ")
capitals = input().split(", ")
countries_capitals = {country:capital for country, capital in zip(countries, capitals) }
print('\n'.join([f"{key} -> {value}" for key, value in countries_capitals.items()])) | [
9127,
1678,
796,
5128,
22446,
35312,
7,
1600,
366,
8,
198,
11128,
8321,
796,
5128,
22446,
35312,
7,
1600,
366,
8,
198,
198,
9127,
1678,
62,
11128,
8321,
796,
1391,
19315,
25,
27544,
329,
1499,
11,
3139,
287,
19974,
7,
9127,
1678,
11... | 3.077922 | 77 |
import numba as nb
import numpy as np
from .frame import Frame
from .particles import Particles
from .utils import serialize
| [
11748,
997,
7012,
355,
299,
65,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
764,
14535,
1330,
25184,
198,
6738,
764,
3911,
2983,
1330,
2142,
2983,
198,
6738,
764,
26791,
1330,
11389,
1096,
628,
198
] | 3.555556 | 36 |
cont = ('Zero', 'UM', 'DOIS', 'TRÊS', 'QUATRO', 'CINCO',
'SEIS', 'SETE', 'OITO', 'NOVE', 'DEZ')
while True:
num = int(input('Digite um número entre 0 e 10: '))
if 0 <= num <= 10:
break
print('TENTE NOVAMENTE.', end='')
print(f'Você digitou {cont[num]}') | [
3642,
796,
19203,
28667,
3256,
705,
5883,
3256,
705,
18227,
1797,
3256,
705,
5446,
127,
232,
50,
3256,
705,
10917,
1404,
13252,
3256,
705,
34,
1268,
8220,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
5188,
1797,
3256,
705,
28480... | 1.978873 | 142 |
""""Unit tests for the outbox."""
import unittest
from unittest.mock import patch
from models.metric_notification_data import MetricNotificationData
from models.notification import Notification
from outbox import Outbox
class OutboxTestCase(unittest.TestCase):
"""Unit tests for the outbox."""
def setUp(sel... | [
15931,
15931,
26453,
5254,
329,
262,
503,
3524,
526,
15931,
198,
198,
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
6738,
4981,
13,
4164,
1173,
62,
1662,
2649,
62,
7890,
1330,
3395,
1173,
3673,
2... | 2.355489 | 2,332 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-02-03 09:46
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
1507,
319,
13130,
12,
2999,
12,
3070,
7769,
25,
3510,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198... | 2.754386 | 57 |
import copy
from collections import namedtuple
import numpy as np
import torch
from torchvision import transforms
from PIL import Image, ImageFilter, ImageEnhance
# An augmentation object consists of its name, the transform functions of type
# torchvision.transforms, and the resulting augmented dataset of type
# torc... | [
11748,
4866,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
10178,
1330,
31408,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
22417,
11,
7412,
35476,
590,
198,
198,
2... | 2.448843 | 2,248 |
def test_read_oeb():
"""Test load oemol from oeb file"""
from openeye import oechem
from gin.i_o.utils import file_to_oemols
filename = 'data/benzoic_acid.oeb'
oemol = file_to_oemols(filename)
assert isinstance(oemol, oechem.OEMol)
def test_oemol_to_dict():
""" Test write oemol to dict of ... | [
198,
4299,
1332,
62,
961,
62,
78,
1765,
33529,
198,
220,
220,
220,
37227,
14402,
3440,
267,
368,
349,
422,
267,
1765,
2393,
37811,
198,
220,
220,
220,
422,
1280,
25379,
1330,
267,
721,
4411,
198,
220,
220,
220,
422,
39733,
13,
72,
... | 1.52628 | 1,465 |
from datetime import date, datetime
from urllib.request import urlopen
from warnings import warn
from xml.etree.ElementTree import Element, ElementTree
import pandas as pd
from ..exceptions import PriceNotFoundError, BadDataError
XML_URL = 'https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.xml'
ECB_NS = {
... | [
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
9654,
198,
6738,
14601,
1330,
9828,
198,
6738,
35555,
13,
316,
631,
13,
20180,
27660,
1330,
11703,
11,
11703,
27660,
198,
198,
11748,
19798... | 2.792179 | 1,790 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import lib.sha1_hmac
import bottle
import time
from bottle import Bottle, run, view, request
from datetime import datetime
def sleep_min(amount):
'''
This function check that the webserver sleep the appropriate amount of time.
Time resolution :
- approx. 1 ms... | [
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,
9195,
13,
26270,
16,
62,
71,
20285,
220,
220,
198,
11748,
9294,
198,
11748,
640,
198,
6738,
9294,
1330,
3... | 2.592593 | 297 |
import requests
from bs4 import BeautifulSoup
import time
import csv
from itertools import cycle
annonces=[]
ccs = ['690275'; '690277'; '690271'; '690256'; '690282'; '690290'; '690266'; '690383'; '690386'; '690034'; '690029']
header = {'user-agent': 'Mozilla/5.0 (Macintosh, Intel Mac OS X 10_8_4) AppleWebKit/536.30.1... | [
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
640,
198,
11748,
269,
21370,
198,
6738,
340,
861,
10141,
1330,
6772,
198,
198,
8825,
728,
28,
21737,
198,
198,
535,
82,
796,
37250,
35844,
23195,
17020,
705,
358... | 1.972764 | 2,460 |
"""
Exits
Exits are connectors between Rooms. An exit always has a destination property
set and has a single command defined on itself with the same name as its key,
for allowing Characters to traverse the exit to its destination.
"""
from evennia import DefaultExit
from contrib import wilderness
from contrib import ... | [
37811,
198,
3109,
896,
198,
198,
3109,
896,
389,
34472,
1022,
42043,
13,
1052,
8420,
1464,
468,
257,
10965,
3119,
198,
2617,
290,
468,
257,
2060,
3141,
5447,
319,
2346,
351,
262,
976,
1438,
355,
663,
1994,
11,
198,
1640,
5086,
26813,
... | 2.517159 | 1,253 |
# -*- coding: utf-8
from django.apps import AppConfig
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
198,
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 2.75 | 20 |
from typing import Callable, List, TypeVar, Union
from collections import deque
T = TypeVar('T')
class AStarList(deque):
"""Essentially a `deque` with a sorted insertion method that uses a state's f_star value as a key."""
class AStarSearch:
"""
An A* search starting from a given datapoint, `start`.
... | [
6738,
19720,
1330,
4889,
540,
11,
7343,
11,
5994,
19852,
11,
4479,
198,
6738,
17268,
1330,
390,
4188,
628,
198,
51,
796,
5994,
19852,
10786,
51,
11537,
628,
198,
4871,
317,
8248,
8053,
7,
2934,
4188,
2599,
198,
220,
220,
220,
37227,
... | 2.308181 | 1,418 |
from dbus_next.service import ServiceInterface, method, dbus_property, signal, Variant
from dbus_next.aio import MessageBus
from mycroft_bus_client import MessageBusClient, Message
from time import sleep
import asyncio
if __name__ == "__main__":
asyncio.get_event_loop().run_until_complete(main())
| [
6738,
288,
10885,
62,
19545,
13,
15271,
1330,
4809,
39317,
11,
2446,
11,
288,
10885,
62,
26745,
11,
6737,
11,
38215,
198,
6738,
288,
10885,
62,
19545,
13,
64,
952,
1330,
16000,
16286,
198,
6738,
616,
36714,
62,
10885,
62,
16366,
1330,... | 3.366667 | 90 |
import psycopg2
import os
DUMP_FILEPATH = "./test_data/dumps/{name}.sql"
| [
11748,
17331,
22163,
70,
17,
198,
11748,
28686,
198,
198,
35,
20476,
62,
25664,
34219,
796,
366,
19571,
9288,
62,
7890,
14,
67,
8142,
14,
90,
3672,
27422,
25410,
1,
628
] | 2.419355 | 31 |
import mal_types as mal
class MalEnv():
"""Mal environment class.
An environment mapping symbols to Mal objects. Note that the symbols should
be strings, not Mal objects, although the initializer accepts both strings
naming symbols and mal_types.Symbol.
"""
| [
11748,
6428,
62,
19199,
355,
6428,
628,
198,
4871,
4434,
4834,
85,
33529,
198,
220,
220,
220,
37227,
15029,
2858,
1398,
13,
628,
220,
220,
220,
1052,
2858,
16855,
14354,
284,
4434,
5563,
13,
5740,
326,
262,
14354,
815,
198,
220,
220,
... | 3.662338 | 77 |
"""
Your task is to construct a building which will be a pile of n cubes.
The cube at the bottom will have a volume of n^3, the cube above will have volume of (n-1)^3 and so on until the top
which will have a volume of 1^3.
You are given the total volume m of the building. Being given m can you find the number n of cub... | [
37811,
198,
7120,
4876,
318,
284,
5678,
257,
2615,
543,
481,
307,
257,
14540,
286,
299,
34896,
13,
198,
464,
23441,
379,
262,
4220,
481,
423,
257,
6115,
286,
299,
61,
18,
11,
262,
23441,
2029,
481,
423,
6115,
286,
357,
77,
12,
16,... | 3.307692 | 169 |
from collections import deque
import matplotlib.pyplot as pyplot
import numpy as np
fig = pyplot.figure()
| [
6738,
17268,
1330,
390,
4188,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
12972,
29487,
198,
11748,
299,
32152,
355,
45941,
198,
198,
5647,
796,
12972,
29487,
13,
26875,
3419,
198
] | 3.34375 | 32 |
"""
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).
Find the minimum element.
You may assume no duplicate exists in the array.
"""
import sys
__author__ = 'Danyang'
if __name__ == "__main__":
num = [7, 1, 2, 3, 4, 5, 6]
assert S... | [
37811,
198,
15979,
577,
257,
23243,
7177,
318,
38375,
379,
617,
30355,
6439,
284,
345,
27091,
13,
198,
198,
7,
72,
13,
68,
1539,
657,
352,
362,
604,
642,
718,
767,
1244,
1716,
604,
642,
718,
767,
657,
352,
362,
737,
198,
198,
1674... | 2.784 | 125 |
#!/bin/env python
# Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract
# DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government
# retains certain rights in this software.
import pprint
import slycat.web.client... | [
2,
48443,
8800,
14,
24330,
21015,
198,
2,
15069,
357,
66,
8,
2211,
11,
2864,
2351,
8987,
290,
14044,
23555,
286,
3837,
544,
11,
11419,
764,
4698,
262,
2846,
286,
17453,
198,
2,
5550,
12,
4535,
830,
2327,
1495,
351,
2351,
8987,
290,
... | 3.625731 | 171 |
"""
Base class for Filters, Factors and Classifiers
"""
from abc import ABCMeta, abstractproperty, abstractmethod
from bisect import insort
from collections.abc import Mapping
from weakref import WeakValueDictionary
from numpy import (
array,
dtype as dtype_class,
ndarray,
)
from zipline.assets import Ass... | [
37811,
198,
14881,
1398,
329,
7066,
1010,
11,
41140,
290,
5016,
13350,
198,
37811,
198,
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
26745,
11,
12531,
24396,
198,
6738,
47457,
478,
1330,
1035,
419,
198,
6738,
17268,
13,
39305,
1330,
337... | 2.332024 | 11,204 |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
2,
15069,
33448,
43208,
21852,
1766,
1539,
12052,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198... | 2.327824 | 1,089 |
import unittest
from .dirkBase import *
from .cacheUtil import *
import ubelt as ub
@缓存('name', 'func') # boilerplate:1
| [
11748,
555,
715,
395,
198,
198,
6738,
764,
67,
14232,
14881,
1330,
1635,
198,
6738,
764,
23870,
18274,
346,
1330,
1635,
198,
11748,
20967,
2120,
355,
20967,
628,
198,
31,
163,
120,
241,
27764,
246,
10786,
3672,
3256,
705,
20786,
11537,
... | 2.571429 | 49 |
# pylint: disable=protected-access
import pytest
from dagster.check import CheckError
| [
2,
279,
2645,
600,
25,
15560,
28,
24326,
12,
15526,
198,
11748,
12972,
9288,
198,
6738,
48924,
1706,
13,
9122,
1330,
6822,
12331,
628,
198
] | 3.52 | 25 |
# Generated by Django 3.1.1 on 2020-09-17 14:55
import core.utils
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
16,
319,
12131,
12,
2931,
12,
1558,
1478,
25,
2816,
198,
198,
11748,
4755,
13,
26791,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11... | 3.070175 | 57 |
from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
from checkov.common.models.enums import CheckCategories
from checkov.common.models.consts import ANY_VALUE
check = K8SEtcdKMSEncryption() | [
6738,
2198,
709,
13,
353,
430,
687,
13,
42116,
13,
31092,
13,
8692,
62,
31092,
62,
8367,
62,
9122,
1330,
7308,
26198,
11395,
9787,
198,
6738,
2198,
709,
13,
11321,
13,
27530,
13,
268,
5700,
1330,
6822,
34,
26129,
198,
6738,
2198,
70... | 3.291667 | 72 |
# copy from https://keras.io/applications
# with minor modification and more document
from keras.applications.vgg19 import VGG19
from keras.preprocessing import image
from keras.applications.vgg19 import preprocess_input
from keras.models import Model
import numpy as np
base_model = VGG19(weights='imagenet')
base_mo... | [
2,
4866,
422,
3740,
1378,
6122,
292,
13,
952,
14,
1324,
677,
602,
198,
2,
351,
4159,
17613,
290,
517,
3188,
198,
198,
6738,
41927,
292,
13,
1324,
677,
602,
13,
85,
1130,
1129,
1330,
569,
11190,
1129,
198,
6738,
41927,
292,
13,
386... | 3.119266 | 327 |
from discord.ext import commands, tasks
from cogs.aux_functions import *
from datetime import datetime
import json
import pandas as pd
from Encoder import *
import os
LOOP_TIME = 720
class Scan(commands.Cog):
""" ----------------------------------------------------------------------------------------------------... | [
6738,
36446,
13,
2302,
1330,
9729,
11,
8861,
198,
6738,
269,
18463,
13,
14644,
62,
12543,
2733,
1330,
1635,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
33918,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
14711,
12342,
1330,... | 4.87156 | 436 |
import os
import docker
from letterparser import utils
| [
11748,
28686,
198,
11748,
36253,
198,
6738,
3850,
48610,
1330,
3384,
4487,
628,
628
] | 4.142857 | 14 |
"""
Module: 'flowlib.lib.emoji' on M5 FlowUI v1.4.0-beta
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.11.0', version='v1.11-284-g5d8e1c867 on 2019-08-30', machine='ESP32 module with ESP32')
# Stubber: 1.3.1
class Emoji:
''
lcd = None
| [
37811,
198,
26796,
25,
705,
2704,
4883,
571,
13,
8019,
13,
368,
31370,
6,
319,
337,
20,
27782,
10080,
410,
16,
13,
19,
13,
15,
12,
31361,
198,
37811,
198,
2,
13122,
52,
25,
357,
17597,
3672,
11639,
9774,
2624,
3256,
18666,
12453,
... | 2.152542 | 118 |
"""
test_itunes.py
Copyright © 2015 Alex Danoff. All Rights Reserved.
2015-08-02
This file tests the functionality provided by the itunes module.
"""
import unittest
from datetime import datetime
from itunes.itunes import parse_value, run_applescript, play_track
from itunes.exceptions import AppleScriptError, Track... | [
37811,
198,
9288,
62,
270,
4015,
13,
9078,
198,
198,
15269,
10673,
1853,
4422,
6035,
2364,
13,
1439,
6923,
33876,
13,
198,
4626,
12,
2919,
12,
2999,
198,
198,
1212,
2393,
5254,
262,
11244,
2810,
416,
262,
340,
4015,
8265,
13,
198,
3... | 3.296875 | 128 |
import boto3
import shell as sh
import datetime
import contextlib
import traceback
import logging
import os
import sys
import util.iter
import util.log
import util.cached
import util.dicts
import util.retry
from util.colors import red
stderr = lambda *a: print(*a, file=sys.stderr)
@util.cached.memoize
@util.cached.m... | [
11748,
275,
2069,
18,
198,
11748,
7582,
355,
427,
198,
11748,
4818,
8079,
198,
11748,
4732,
8019,
198,
11748,
12854,
1891,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
7736,
13,
2676,
198,
11748,
7736,
13,
6404,
... | 2.453704 | 432 |
"""
Calculate and Classify Normalized Difference Results with EarthPy
==================================================================
Learn how to calculate and classify normalized difference indices in Python using EarthPy.
This example shows how to calculate and classify the normalized difference vegetation
index... | [
37811,
198,
9771,
3129,
378,
290,
5016,
1958,
14435,
1143,
43795,
15691,
351,
3668,
20519,
198,
23926,
855,
198,
198,
20238,
703,
284,
15284,
290,
36509,
39279,
3580,
36525,
287,
11361,
1262,
3668,
20519,
13,
198,
1212,
1672,
2523,
703,
... | 3.644872 | 1,560 |
import tensorflow as tf | [
198,
11748,
11192,
273,
11125,
355,
48700
] | 3.428571 | 7 |
from .hex_api import * | [
6738,
764,
33095,
62,
15042,
1330,
1635
] | 3.142857 | 7 |
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2019 all rights reserved
#
# get the framework
import pyre
# the base class for my exceptions
class AmpcorError(pyre.PyreError):
"""
Base class for all ampcor errors
"""
# component configuration errors
class ConfigurationError(Amp... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
285,
40302,
257,
13,
70,
13,
257,
26884,
85,
6557,
89,
271,
198,
2,
29617,
39795,
198,
2,
357,
66,
8,
7795,
12,
23344,
477,
2489,
10395,
198,
2,
628,
... | 3.044693 | 179 |
"""
Performance Utilz
"""
import time
import anyio
import multiprocessing
from functools import wraps, partial
from typing import Callable, Dict, List, Any, Union, Iterable, Generator, Optional
from .utils import *
from ..helpers import get_logger
try:
import trio
_async_backend = 'trio'
except: _async_bac... | [
37811,
198,
32273,
7273,
346,
89,
198,
37811,
198,
11748,
640,
198,
11748,
597,
952,
198,
11748,
18540,
305,
919,
278,
198,
6738,
1257,
310,
10141,
1330,
27521,
11,
13027,
198,
198,
6738,
19720,
1330,
4889,
540,
11,
360,
713,
11,
7343... | 2.70771 | 869 |
#!/usr/bin/env python
# ===============================================================================
# weather.py
#
# Get weather forecast from NOAA and display as 8x8 icons
# * NOAA's doc: http://digital.weather.gov/xml/rest.php
# * Set location using zipcode
# * Use 12+hourly format
# * Somewhat generalize... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
38093,
25609,
855,
198,
2,
6193,
13,
9078,
198,
2,
198,
2,
3497,
6193,
11092,
422,
36184,
290,
3359,
355,
807,
87,
23,
17149,
198,
2,
220,
220,
1635,
36184,
338,
2205,
25,
2638,... | 2.414059 | 2,461 |
# Copyright 2019 The IEVA-DGM Authors. All rights reserved.
# Use of this source code is governed by a MIT-style license that can be
# found in the LICENSE file.
# mpas dataset
from __future__ import absolute_import, division, print_function
import os
import pandas as pd
import numpy as np
from skimage import io, t... | [
2,
15069,
13130,
383,
314,
27881,
12,
35,
15548,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
17168,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
... | 3.03125 | 320 |
from pysh import core
from pysh.bash import scope
| [
6738,
279,
893,
71,
1330,
4755,
198,
6738,
279,
893,
71,
13,
41757,
1330,
8354,
198
] | 3.125 | 16 |
from __future__ import annotations
from typing import Optional
from jsonclasses import jsonclass, types
@jsonclass
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
19720,
1330,
32233,
198,
6738,
33918,
37724,
1330,
33918,
4871,
11,
3858,
628,
198,
31,
17752,
4871,
198
] | 4.5 | 26 |
#Imports
import RPi.GPIO as GPIO
import time
import os
#variables
steeringPin = 15
motorPin = 18
GPIO.cleanup()
#Setup
GPIO.setmode(GPIO.BCM)
GPIO.setup(steeringPin, GPIO.OUT)
GPIO.setup(motorPin, GPIO.OUT)
steeringPWM = GPIO.PWM(steeringPin, 50)
motorPWM = GPIO.PWM(motorPin, 50)
currentDut... | [
2,
3546,
3742,
201,
198,
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
201,
198,
11748,
640,
201,
198,
11748,
28686,
201,
198,
201,
198,
2,
25641,
2977,
201,
198,
4169,
1586,
28348,
796,
1315,
220,
201,
198,
76,
20965,
28348,
796,
... | 2.005505 | 545 |
from fastapi import status, Depends, APIRouter, HTTPException
from sqlalchemy.orm import Session
from sqlalchemy.exc import IntegrityError
from app.spoonderful.auth import utils
from app.spoonderful.data import database, models, schemas
router = APIRouter(tags=["Sign Up"])
@router.post(
"/register", status_code... | [
6738,
3049,
15042,
1330,
3722,
11,
2129,
2412,
11,
3486,
4663,
39605,
11,
14626,
16922,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
23575,
198,
6738,
44161,
282,
26599,
13,
41194,
1330,
39348,
12331,
198,
6738,
598,
13,
2777,
78,
8623,... | 2.924107 | 448 |
print sum(len(s[:-1]) - len(eval(s)) for s in open('input8.txt'))
print sum(2+s.count('\\')+s.count('"') for s in open('input8.txt'))
for s in open("input8.txt"):
print eval(s), len(eval(s))
print s, len(s),
print
| [
4798,
2160,
7,
11925,
7,
82,
58,
21912,
16,
12962,
532,
18896,
7,
18206,
7,
82,
4008,
329,
264,
287,
1280,
10786,
15414,
23,
13,
14116,
6,
4008,
198,
4798,
2160,
7,
17,
10,
82,
13,
9127,
10786,
6852,
11537,
10,
82,
13,
9127,
107... | 2.234694 | 98 |