content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#!/usr/bin/env python2
# -*- encoding: utf-8 -*-
# Gimp Markup Builder
# author: duangsuse
# date: Thu May 02 2019 CST
from os import linesep
from Util import stream_join
class MarkupBuilder:
''' Gimp Markup SGML builder '''
'''
Indent rules:
when starting new tag, write last spaces, last spaces += indent... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
402,
11011,
2940,
929,
35869,
198,
2,
1772,
25,
7043,
27725,
1904,
198,
2,
3128,
25,
26223,
1737,
7816,
... | 2.37605 | 1,904 |
from pkg_resources import DistributionNotFound, get_distribution, parse_version
try:
import psycopg2 # noqa: F401
except ImportError:
raise ImportError(
'No module named psycopg2. Please install either '
'psycopg2 or psycopg2-binary package for CPython '
'or psycopg2cffi for Pypy.'
... | [
6738,
279,
10025,
62,
37540,
1330,
27484,
3673,
21077,
11,
651,
62,
17080,
3890,
11,
21136,
62,
9641,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
17331,
22163,
70,
17,
220,
1303,
645,
20402,
25,
376,
21844,
198,
16341,
17267,
12331... | 2.594203 | 345 |
# -*- coding: utf-8 -*-
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198
] | 1.714286 | 14 |
"""
This module contains the top level API for managing the project/file templates.
"""
import json
import logging
import os
import re
from binaryornot.check import is_binary
from hackedit.app import settings
def create(template, dest_dir, answers):
"""
Creates a file/project from the specified template, at... | [
37811,
198,
1212,
8265,
4909,
262,
1353,
1241,
7824,
329,
11149,
262,
1628,
14,
7753,
24019,
13,
198,
37811,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
302,
198,
198,
6738,
13934,
1211,
313,
13,
9122,
1330,
318... | 2.184029 | 3,043 |
"""
Convert video format x to MP4/H.264.
"""
import os
import sys
import logging
from .videometainfo import VideoMetaInfo
from .utils import sizeof_fmt, time_fmt, find_files, check_dependencies, call, ffmpeg
logger = logging.getLogger(__name__)
class VideoToMP4:
"""To Mp4"""
SUPPORTED_EXTENSIONS = ".wmv, .... | [
37811,
198,
3103,
1851,
2008,
5794,
2124,
284,
4904,
19,
14,
39,
13,
18897,
13,
198,
37811,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
18931,
198,
198,
6738,
764,
85,
485,
908,
391,
6513,
1330,
7623,
48526,
12360,
198,
673... | 2.002782 | 719 |
from setuptools import setup
setup(
name='parasol',
dependency_links=[
],
install_requires=[
]
)
| [
6738,
900,
37623,
10141,
1330,
9058,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
1845,
292,
349,
3256,
198,
220,
220,
220,
20203,
62,
28751,
41888,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
2721,
62,
47911,
41888,
198,
220,
... | 2.4375 | 48 |
# Generated by Django 3.2.8 on 2021-11-02 12:46
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
23,
319,
33448,
12,
1157,
12,
2999,
1105,
25,
3510,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import csv
import io
import json
import logging
import os
import warnings
from collections import defaultdict
from ..utils.exceptions import OasisException
from ..utils.log import oasis_log
from .files import GENERAL_SETTINGS_FILE, GUL_SUMMARIES_FILE, IL_SUMMARIES_FILE, MODEL_SETTINGS_FILE
def _get_summaries(summar... | [
11748,
269,
21370,
198,
11748,
33245,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
14601,
198,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
6738,
11485,
26791,
13,
1069,
11755,
1330,
440,
17765,
16922,
198,
6738,
... | 2.540594 | 2,020 |
#!/usr/bin/env python
#--------------------------------------------------------------------------------
#Changes the sky coordinates (x,y,z) to the disk coordinates (x_d,y_d,z_d)
#The x axis is the rotation axis
#--------------------------------------------------------------------------------
#Radiative transfer equa... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
10097,
1783,
198,
2,
29238,
262,
6766,
22715,
357,
87,
11,
88,
11,
89,
8,
284,
262,
11898,
22715,
357,
87,
62,
67,
11,
88,
62,
67,
11,
89,
62,
67,
8,
198,
2,
464,
212... | 3.043411 | 645 |
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 16 18:06:05 2021
@author: jhask
"""
import csv
import pandas as pd
import numpy as np
import re
import scipy.io as sio
import os
# Map MCM names to TUV labels
j_vals_dict= dict({
'O3 -> O2 + O(1D)':'J1',
'O3 -> O2 + O(3P)':'J2',
'H2O2 -> 2 OH':'J3',... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
3300,
7653,
1467,
1248,
25,
3312,
25,
2713,
33448,
201,
198,
201,
198,
31,
9800,
25,
474,
71,
2093,
201,
198,
37811,
201,
198,
11748,... | 1.792441 | 1,614 |
'''
Imports
'''
from config import *
from newspaper import Article
import sys as sys
import pandas as pd
import csv
from collections import defaultdict
import re
'''
URL Extract
'''
columns = defaultdict(list)
with open('SecurityIDRBT.csv') as f:
reader = csv.DictReader(f) # read rows into a diction... | [
7061,
6,
201,
198,
3546,
3742,
201,
198,
7061,
6,
201,
198,
6738,
4566,
1330,
1635,
201,
198,
6738,
7533,
1330,
10172,
201,
198,
11748,
25064,
355,
25064,
201,
198,
11748,
19798,
292,
355,
279,
67,
220,
201,
198,
11748,
269,
21370,
... | 2.284014 | 588 |
# -*- coding: utf-8 -*-
# Copyright 2018, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
# pylint: disable=missing-docstring
from qiskit.mapper import _coupling
from .common import QiskitTestCase
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
2864,
11,
19764,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
1043,
287,
198,
2,
262,
38559,
24290... | 3.177083 | 96 |
import os
import re
import k3d
import types
import random
import pytest
import numbers
import tempfile
import itertools
import numpy as np
import discretisedfield as df
import matplotlib.pyplot as plt
from .test_mesh import TestMesh
| [
11748,
28686,
198,
11748,
302,
198,
11748,
479,
18,
67,
198,
11748,
3858,
198,
11748,
4738,
198,
11748,
12972,
9288,
198,
11748,
3146,
198,
11748,
20218,
7753,
198,
11748,
340,
861,
10141,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
... | 3.405797 | 69 |
__all__ = ['get']
import collections
def get(input):
"""return a list with input values or [] if input is None"""
if input is None:
return []
if not _iterable(input) or _string(input):
return [input]
return list(input)
| [
834,
439,
834,
796,
37250,
1136,
20520,
628,
198,
11748,
17268,
628,
628,
198,
4299,
651,
7,
15414,
2599,
198,
220,
220,
220,
37227,
7783,
257,
1351,
351,
5128,
3815,
393,
17635,
611,
5128,
318,
6045,
37811,
198,
220,
220,
220,
611,
... | 2.677083 | 96 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/8/20 0020 16:49
# @Author : Hadrianl
# @File : __init__.py
from .widget import StrategyReviewer | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
220,
220,
220,
1058,
13130,
14,
23,
14,
1238,
3571,
1238,
1467,
25,
2920,
198,
2,
2488,
13838,
220,
... | 2.323944 | 71 |
import xml.etree.ElementTree as ET
xml_string = '''
<stuff>
<users>
<user x = "2">
<id>001</id>
<name>Chuck</name>
</user>
<user x = "7">
<id>007</id>
<name>Brent</name>
</user>
</users>
</stuff>
'''
root_stuff = ET.fromstring(xml... | [
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
198,
19875,
62,
8841,
796,
705,
7061,
198,
27,
41094,
29,
198,
220,
220,
220,
1279,
18417,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
7220,
2124,
796,
366,
17,
... | 2.142384 | 302 |
from multiprocessing.dummy import Pool
pool = Pool(3)
origin_num = [x for x in range(10)]
result = pool.map(calc_power2, origin_num)
print(f'计算1-10的平方分别为:{result}')
| [
6738,
18540,
305,
919,
278,
13,
67,
13513,
1330,
19850,
628,
198,
7742,
796,
19850,
7,
18,
8,
198,
47103,
62,
22510,
796,
685,
87,
329,
2124,
287,
2837,
7,
940,
15437,
198,
20274,
796,
5933,
13,
8899,
7,
9948,
66,
62,
6477,
17,
... | 2.060976 | 82 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
from django.core.urlresolvers import reverse
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.core.urlresolvers import reverse_lazy
from django.utils.decorators import method_decorator
f... | [
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
13,
49170,
1330,
42585,
7680,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
13,
4868,
1330,
7343,
7680,
198,
6738,
42625,... | 3.5 | 126 |
from typing import Any, Optional, Tuple, Union
import torch
from torch.nn.functional import mse_loss
import pystiche
import pystiche.loss.functional as F
from pystiche import enc, loss
from pystiche_papers.utils import HyperParameters
from ._utils import (
extract_normalized_patches2d,
hyper_parameters as _h... | [
6738,
19720,
1330,
4377,
11,
32233,
11,
309,
29291,
11,
4479,
198,
198,
11748,
28034,
198,
6738,
28034,
13,
20471,
13,
45124,
1330,
285,
325,
62,
22462,
198,
198,
11748,
12972,
11268,
258,
198,
11748,
12972,
11268,
258,
13,
22462,
13,
... | 2.511022 | 2,994 |
# -*- coding: utf-8 -*-
# (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <[email protected]>
"""
Configuration file for the pytest tests.
"""
import os
import json
import pytest
import numpy as np
import bands_inspect as bi
import parameters # pylint: disable=wrong-import-order... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
357,
66,
8,
2177,
12,
23344,
11,
35920,
43412,
11,
37931,
315,
14035,
263,
383,
9997,
46097,
8687,
1134,
198,
2,
6434,
25,
11817,
1134,
402,
411,
354,
1279,
... | 3.191898 | 469 |
import os
# import tensorflow as tf
import tensorrt as trt
from tensorrt.parsers import uffparser
import pycuda.driver as cuda
# import uff
import cv2
import numpy as np
from tqdm import tqdm
TEST_PATH = "/media/andy/Data/DevWorkSpace/Projects/imageClassifier/data/test/"
LABEL = 0
ENGINE_PATH = "/home/andy/caffe/exa... | [
11748,
28686,
198,
2,
1330,
11192,
273,
11125,
355,
48700,
198,
11748,
11192,
273,
17034,
355,
491,
83,
198,
6738,
11192,
273,
17034,
13,
79,
945,
364,
1330,
334,
487,
48610,
198,
11748,
12972,
66,
15339,
13,
26230,
355,
269,
15339,
1... | 2.546108 | 835 |
import filters
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import freqz
from sklearn.neural_network import MLPRegressor
if __name__ == "__main__":
# Create a random dataset
# [fc, bandwidth, gain]
n = 100
filtersNum = 1
X, Y = genXY(n=n, filtersNum=... | [
11748,
16628,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
6738,
629,
541,
88,
13,
12683,
282,
1330,
2030,
80,
89,
201,
198,
6738,
1341,
35720,
13,
710,
1523,
... | 2.078998 | 519 |
import torch.distributed as dist
import torch
def synchronize():
"""
Helper function to synchronize (barrier) among all processes when
using distributed training
"""
if not dist.is_available():
return
if not dist.is_initialized():
return
world_size = dist.get_world_siz... | [
11748,
28034,
13,
17080,
6169,
355,
1233,
198,
11748,
28034,
198,
198,
4299,
18305,
1096,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
5053,
525,
2163,
284,
18305,
1096,
357,
5657,
5277,
8,
1871,
477,
7767,
618... | 2.645833 | 144 |
import json
import pymysql
import datetime
from dbutils.pooled_db import PooledDB
import pymysql
from conf.common import *
mysql_client = MysqlClient()
| [
11748,
33918,
198,
11748,
279,
4948,
893,
13976,
198,
11748,
4818,
8079,
198,
6738,
288,
4360,
4487,
13,
7742,
276,
62,
9945,
1330,
19850,
276,
11012,
198,
11748,
279,
4948,
893,
13976,
198,
198,
6738,
1013,
13,
11321,
1330,
1635,
628,
... | 2.888889 | 54 |
#!/usr/bin/env python
"""
Script to launch a VDI session (or connect to already running session)
and start a Jupyter server on the VDI
A ssh tunnel from the local machine to the VDI is set up and the local
webbrowser is spawned.
This is a python3 script (uses unicode strings). If you don't have
python3 on your local... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
7391,
284,
4219,
257,
569,
17931,
6246,
357,
273,
2018,
284,
1541,
2491,
6246,
8,
198,
392,
923,
257,
449,
929,
88,
353,
4382,
319,
262,
569,
17931,
198,
198,
32,
26678,
... | 2.474803 | 1,647 |
# -*- coding=utf-8 -*-
__all__ = [
'tiny_imagenet',
'imagewoof2',
'imagenette2'
]
import os
import torch
import torchvision
_default_batch_size = 32
_default_num_workers = 4
| [
2,
532,
9,
12,
19617,
28,
40477,
12,
23,
532,
9,
12,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
44152,
62,
320,
11286,
316,
3256,
198,
220,
220,
220,
705,
48466,
413,
37711,
17,
3256,
198,
220,
220,
220,
705,
... | 2.270588 | 85 |
from django.db import models
from django.contrib.auth.models import User
from django.db.models import Sum
from datetime import datetime
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
5060,
198,
6738,
4818,
8079,
1330,
4818,
8079,
628,
198
] | 3.538462 | 39 |
#!/usr/bin/env pytest
import io
import json
from os import path
from pytest import fixture, mark
from sls import App
import storyscript.hub.Hub as StoryHub
from storyhub.sdk.AutoUpdateThread import AutoUpdateThread
from tests.e2e.utils.features import parse_options
from tests.e2e.utils.fixtures import find_test_fi... | [
2,
48443,
14629,
14,
8800,
14,
24330,
12972,
9288,
198,
11748,
33245,
198,
11748,
33918,
198,
6738,
28686,
1330,
3108,
198,
198,
6738,
12972,
9288,
1330,
29220,
11,
1317,
198,
198,
6738,
1017,
82,
1330,
2034,
198,
198,
11748,
1621,
1204... | 3.310526 | 190 |
""" Where's My Mouse? """
import tkinter
root = tkinter.Tk()
root.bind('<Button>', mouse_click)
root.mainloop()
| [
37811,
6350,
338,
2011,
21839,
30,
37227,
201,
198,
11748,
256,
74,
3849,
201,
198,
220,
220,
220,
220,
201,
198,
15763,
796,
256,
74,
3849,
13,
51,
74,
3419,
201,
198,
15763,
13,
21653,
10786,
27,
21864,
29,
3256,
10211,
62,
12976,... | 2.320755 | 53 |
from dataclasses import dataclass
from enum import Enum
from typing import Callable, Dict, Final, Optional, Type, Union
from botx import Bot, Collector, Message
from botx.concurrency import callable_to_coroutine
from botx.middlewares.base import BaseMiddleware
from botx.typing import Executor
_default_transition: Fin... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
4889,
540,
11,
360,
713,
11,
8125,
11,
32233,
11,
5994,
11,
4479,
198,
198,
6738,
10214,
87,
1330,
18579,
11,
17573,
11,
16000,... | 3.441176 | 102 |
#!/usr/bin/env python
'''
This program attempts to convert XPLOR Pseudocontact shift restraints in AMBER format
XPLOR:
assign ( resid 200 and name OO ) ( resid 200 and name Z ) ( resid 200 and name X ) (resid 200 and name Y ) ( resid 13 and name C ) 0.2400 0.2000
assign ( resid 200 and name OO ) ( resid 200 ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
198,
1212,
1430,
6370,
284,
10385,
1395,
6489,
1581,
49693,
463,
420,
756,
529,
6482,
45369,
287,
3001,
13246,
5794,
198,
55,
6489,
1581,
25,
198,
562,
570,
357,
15384,
939,
... | 2.166078 | 1,132 |
"""Versioned body readers and writers for track message bodies.
Attributes:
LATEST_VERSION (int): Latest version supported by the library.
"""
from typing import Callable, Tuple
from . import TrackInfo, codec
LATEST_VERSION = 2
ReaderType = Callable[[codec.Reader], TrackInfo]
WriterType = Callable[[code... | [
37811,
14815,
276,
1767,
7183,
290,
8786,
329,
2610,
3275,
5920,
13,
198,
198,
29021,
25,
198,
220,
220,
220,
42355,
6465,
62,
43717,
357,
600,
2599,
26603,
2196,
4855,
416,
262,
5888,
13,
198,
37811,
198,
198,
6738,
19720,
1330,
4889... | 2.824503 | 302 |
/home/runner/.cache/pip/pool/f3/de/85/7dca1e096a43e00e6ff1ca900dda1ca91c8c5c3a1d6798e466a9173a00 | [
14,
11195,
14,
16737,
11757,
23870,
14,
79,
541,
14,
7742,
14,
69,
18,
14,
2934,
14,
5332,
14,
22,
67,
6888,
16,
68,
2931,
21,
64,
3559,
68,
405,
68,
21,
487,
16,
6888,
12865,
1860,
64,
16,
6888,
6420,
66,
23,
66,
20,
66,
18... | 1.627119 | 59 |
"""
The Alarm Extension provides easy access to setting an application alarm to
handle timing out operations. See the
`Python Signal Library <https://docs.python.org/3.5/library/signal.html>`_.
Requirements
------------
* No external dependencies.
* Only available on Unix/Linux
Configuration
-------------
This ... | [
37811,
198,
464,
978,
1670,
27995,
3769,
2562,
1895,
284,
4634,
281,
3586,
10436,
284,
198,
28144,
10576,
503,
4560,
13,
220,
4091,
262,
198,
63,
37906,
26484,
10074,
1279,
5450,
1378,
31628,
13,
29412,
13,
2398,
14,
18,
13,
20,
14,
... | 2.591203 | 773 |
from meross_iot.cloud.abilities import *
from meross_iot.cloud.device import AbstractMerossDevice
from meross_iot.logger import POWER_PLUGS_LOGGER as l
from meross_iot.meross_event import DeviceSwitchStatusEvent
| [
6738,
4017,
793,
62,
5151,
13,
17721,
13,
5738,
1330,
1635,
198,
6738,
4017,
793,
62,
5151,
13,
17721,
13,
25202,
1330,
27741,
13102,
793,
24728,
198,
6738,
4017,
793,
62,
5151,
13,
6404,
1362,
1330,
40295,
62,
6489,
7340,
50,
62,
2... | 3.380952 | 63 |
from django.db.backends.mysql.introspection import *
from django.db.backends.mysql.introspection import DatabaseIntrospection as MYSQLDatabaseIntrospection
from django.utils.functional import cached_property
| [
6738,
42625,
14208,
13,
9945,
13,
1891,
2412,
13,
28744,
13976,
13,
600,
305,
31308,
1330,
1635,
198,
6738,
42625,
14208,
13,
9945,
13,
1891,
2412,
13,
28744,
13976,
13,
600,
305,
31308,
1330,
24047,
5317,
305,
31308,
355,
337,
16309,
... | 3.516667 | 60 |
import highiq
import numpy as np
| [
11748,
1029,
25011,
198,
11748,
299,
32152,
355,
45941,
628,
628,
628
] | 3.166667 | 12 |
# Base imports
import subprocess
from typing import Iterable, Optional
# Project imports
from docker import common
from docker.run import run
| [
2,
7308,
17944,
198,
11748,
850,
14681,
198,
6738,
19720,
1330,
40806,
540,
11,
32233,
198,
198,
2,
4935,
17944,
198,
6738,
36253,
1330,
2219,
198,
6738,
36253,
13,
5143,
1330,
1057,
628,
198
] | 4.264706 | 34 |
import json
import glob
import numpy as np
import os
path = "data_state_space_v3/"
out_path = "small_data/"
files = glob.glob(path + "*.npy") # ワイルドカードが使用可能
train_data_num = 100
test_data_num = 10
train_data = {}
test_data = {}
for filename in files:
obj = np.load(filename)
if filename.find("_test.npy") >= 0:... | [
11748,
33918,
198,
11748,
15095,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
198,
6978,
796,
366,
7890,
62,
5219,
62,
13200,
62,
85,
18,
30487,
198,
448,
62,
6978,
796,
366,
17470,
62,
7890,
30487,
198,
16624,
796,
150... | 2.206818 | 440 |
# https://www.hackerrank.com/challenges/three-month-preparation-kit-maxsubarray/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'maxSubarray' function below.
#
# The function is expected to return an INTEGER_ARRAY.
# The function accepts INTEGER_ARRAY arr as parameter... | [
2,
3740,
1378,
2503,
13,
31153,
8056,
962,
13,
785,
14,
36747,
34120,
14,
15542,
12,
8424,
12,
3866,
1845,
341,
12,
15813,
12,
9806,
7266,
18747,
14,
45573,
198,
198,
2,
48443,
8800,
14,
29412,
18,
198,
198,
11748,
10688,
198,
11748... | 2.507463 | 268 |
import torch
from torch.nn.modules.module import Module
from torch.autograd import Function
import correlation_cuda
| [
11748,
28034,
198,
6738,
28034,
13,
20471,
13,
18170,
13,
21412,
1330,
19937,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
15553,
198,
11748,
16096,
62,
66,
15339,
628
] | 4.034483 | 29 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.ops import data_flow_ops
import tensorflow.contrib.tensorrt as trt
import numpy as np
import time
from tensorflow.python.platform import gfile
from tensorflow.pyt... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
29412,
13,
2... | 2.707317 | 861 |
import Adafruit_SSD1306
import Image
import ImageDraw
import ImageFont
# I2C ADDRESS / BITS
SSD1306_ADDRESS = 0x3C
| [
11748,
1215,
1878,
4872,
62,
5432,
35,
12952,
21,
198,
11748,
7412,
198,
11748,
7412,
25302,
198,
11748,
7412,
23252,
198,
198,
2,
314,
17,
34,
5984,
7707,
7597,
1220,
347,
29722,
198,
5432,
35,
12952,
21,
62,
2885,
7707,
7597,
796,
... | 2.489362 | 47 |
if __name__ == '__main__':
print compute(1, 0.1) # default values
| [
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
3601,
24061,
7,
16,
11,
657,
13,
16,
8,
1303,
4277,
3815,
628
] | 2.571429 | 28 |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
from ..optimization import discretization
from ..common.decorators import Registry
registry = Regist... | [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
1439,
6923,
33876,
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,
... | 2.67087 | 793 |
string = input()
d = {}
for i in string:
if i in d:
d[i] += 1
else:
d[i] = 1
s = sorted(sorted(d), key = d.get, reverse = True)
for i in s[:3]:
print(i, d[i])
| [
8841,
796,
5128,
3419,
198,
67,
796,
23884,
198,
1640,
1312,
287,
4731,
25,
198,
220,
220,
220,
611,
1312,
287,
288,
25,
198,
220,
220,
220,
220,
220,
220,
220,
288,
58,
72,
60,
15853,
352,
198,
220,
220,
220,
2073,
25,
198,
220... | 1.888889 | 99 |
for row in solve(10):
print(row)
| [
198,
198,
1640,
5752,
287,
8494,
7,
940,
2599,
198,
220,
220,
220,
3601,
7,
808,
8,
198
] | 2.166667 | 18 |
import random
import string
from subprocess import run
from types import SimpleNamespace
import psycopg2
import versions
from docker_helpers import get_image_name, pull, exec_safely
from service_config import api_db_user
from settings import get_secret
root_user = "vimc"
# these tables should only be modified via sq... | [
11748,
4738,
198,
11748,
4731,
198,
6738,
850,
14681,
1330,
1057,
198,
6738,
3858,
1330,
17427,
36690,
10223,
198,
198,
11748,
17331,
22163,
70,
17,
198,
198,
11748,
6300,
198,
6738,
36253,
62,
16794,
364,
1330,
651,
62,
9060,
62,
3672,... | 2.615987 | 638 |
#!/usr/bin/env python3
import poplib
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='MailBox basic params')
parser.add_argument('--hostname', action="store", dest="hostname")
parser.add_argument('--port', action="store", dest="port")
parser.add_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1461,
8019,
198,
11748,
1822,
29572,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
30751,
796,
1822,
29572... | 2.557312 | 253 |
import sys
import time
import redis
from openob.rtp.tx import RTPTransmitter
from openob.rtp.rx import RTPReceiver
import gst
from colorama import Fore, Back, Style
# OpenOB Link Manager
# One of these runs at each end and negotiates everything (RX pushes config info to TX), reconnects when links fail, and so o... | [
11748,
25064,
201,
198,
11748,
640,
201,
198,
11748,
2266,
271,
201,
198,
6738,
1280,
672,
13,
17034,
79,
13,
17602,
1330,
371,
7250,
8291,
37974,
201,
198,
6738,
1280,
672,
13,
17034,
79,
13,
40914,
1330,
371,
7250,
3041,
39729,
201,... | 3.4 | 125 |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
16529,
26171,
198,
2,
198,
2,
220,
220,
15069,
2864,
12,
23344,
376,
7569,
13,
20185,
15302,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
3... | 2.337744 | 4,610 |
try:
from mpi4py import MPI # @UnusedImport @IgnorePep8 This is imported before NEURON to avoid a bug in NEURON
except ImportError:
mpi_comm = DummyMPICom()
else:
mpi_comm = MPI.COMM_WORLD
MPI_ROOT = 0
| [
198,
28311,
25,
198,
220,
220,
220,
422,
285,
14415,
19,
9078,
1330,
4904,
40,
220,
1303,
2488,
3118,
1484,
20939,
2488,
32916,
382,
47,
538,
23,
770,
318,
17392,
878,
10635,
4261,
1340,
284,
3368,
257,
5434,
287,
10635,
4261,
1340,
... | 2.369565 | 92 |
# -*- coding: utf-8 -*-
"""Unpacks Raw API data from zkillboard into victim files that contain
TEST - 10/02/2019
Params: 10000002201505.csv | 61MB | 28208 rows x 8 columns
Output:
```
(+0.000s|t:0.000s) Importing modules...
(+2.209s|t:2.209s) Loading CSV data from local file...
(+1.132s|t:3.341s) Converting DataFrame... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
3118,
32377,
16089,
7824,
1366,
422,
1976,
12728,
3526,
656,
3117,
3696,
326,
3994,
220,
198,
198,
51,
6465,
532,
838,
14,
2999,
14,
23344,
198,
10044,
4105,
25,
... | 1.991009 | 4,004 |
from django.shortcuts import render, get_object_or_404
from django.contrib import messages
from .forms import ReportForm
from data.models import Paper
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
651,
62,
15252,
62,
273,
62,
26429,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
6218,
198,
6738,
764,
23914,
1330,
6358,
8479,
198,
6738,
1366,
13,
27530,
1330,
14962,
198
] | 3.775 | 40 |
#!/usr/bin/python
#stats.py
'''
Classes and functons to implement calculation and output of statistics
'''
#geonomics imports
from geonomics.utils.io import (_append_array2d_to_array_stack,
_append_row_to_csv, _write_dict_to_csv)
from geonomics.ops.selection import _calc_fitness
from ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
34242,
13,
9078,
628,
198,
7061,
6,
198,
9487,
274,
290,
1257,
310,
684,
284,
3494,
17952,
290,
5072,
286,
7869,
198,
7061,
6,
198,
198,
2,
6281,
31994,
17944,
198,
6738,
4903,
6326,
8... | 3.520408 | 686 |
from eve import Eve
from .db_domains import db_domains
import os
SETTINGS = {
'DOMAIN': db_domains,
'MONGO_HOST': 'localhost',
'MONGO_PORT': 27017,
# MONGO_USERNAME': os.environ.get(...),
# MONGO_PASSWORD': os.environ.get(...),
'MONGO_DBNAME': 'quantz',
'RENDERERS': [
'eve.rende... | [
6738,
28001,
1330,
12882,
198,
198,
6738,
764,
9945,
62,
3438,
1299,
1330,
20613,
62,
3438,
1299,
198,
198,
11748,
28686,
628,
198,
198,
28480,
51,
20754,
796,
1391,
198,
220,
220,
220,
705,
39170,
29833,
10354,
20613,
62,
3438,
1299,
... | 1.883527 | 601 |
import datetime as dt
import calendar
import time
def iter_dates(start, end, period):
"""Yield dates from `start` to `end` with step equalt to `period`."""
current = start
while current <= end:
yield current
current += period
def month_last_day(date):
"""Return the last date of the... | [
11748,
4818,
8079,
355,
288,
83,
198,
11748,
11845,
198,
11748,
640,
628,
628,
198,
4299,
11629,
62,
19581,
7,
9688,
11,
886,
11,
2278,
2599,
198,
220,
220,
220,
37227,
56,
1164,
9667,
422,
4600,
9688,
63,
284,
4600,
437,
63,
351,
... | 2.90991 | 222 |
# https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string | [
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
28956,
12,
439,
12,
41255,
12643,
12,
646,
489,
16856,
12,
259,
12,
8841
] | 2.769231 | 26 |
#-*- coding: utf-8 -*-
from py3wirecard.entities.lib.wireentity import *
from py3wirecard.entities.taxdocument import TaxDocument
| [
2,
12,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
12972,
18,
21809,
9517,
13,
298,
871,
13,
8019,
13,
21809,
26858,
1330,
1635,
198,
6738,
12972,
18,
21809,
9517,
13,
298,
871,
13,
19290,
22897,
1330,
9241,
24941,
... | 2.888889 | 45 |
chinese_strings = [
'京', '津', '冀', '晋', '蒙', '辽', '吉', '黑', '沪', '苏',
'浙', '皖', '闽', '赣', '鲁', '豫', '鄂', '湘', '粤', '桂',
'琼', '渝', '川', '贵', '云', '藏', '陕', '甘', '青', '宁',
'新', '港', '澳', '台', '警', 'WJ']
# 36
chinese = [
'Beijing',
'Tianjin',
'Hebei',
'Shanxi',
'InnerMongolia',
'Li... | [
354,
3762,
62,
37336,
796,
685,
198,
220,
220,
220,
705,
12859,
105,
3256,
705,
162,
112,
98,
3256,
705,
37863,
222,
3256,
705,
162,
247,
233,
3256,
705,
164,
240,
247,
3256,
705,
164,
122,
121,
3256,
705,
28938,
231,
3256,
705,
1... | 1.596291 | 701 |
# Generated by Django 3.1.7 on 2021-04-05 14:35
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
22,
319,
33448,
12,
3023,
12,
2713,
1478,
25,
2327,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.818182 | 44 |
"""Main definitions for Virtool Workflows."""
from typing import Any, Callable, Coroutine, Iterable, Optional, Sequence
from virtool_workflow.utils import coerce_to_coroutine_function
from fixtures import FixtureScope
WorkflowStep = Callable[..., Coroutine[Any, Any, None]]
class Workflow:
"""
A Workflow is ... | [
37811,
13383,
17336,
329,
11285,
970,
5521,
44041,
526,
15931,
198,
6738,
19720,
1330,
4377,
11,
4889,
540,
11,
2744,
28399,
11,
40806,
540,
11,
32233,
11,
45835,
198,
6738,
4118,
970,
62,
1818,
11125,
13,
26791,
1330,
31255,
344,
62,
... | 2.454163 | 1,189 |
#coding:utf-8
import threading
import time
import pytest
from .connect import DataClient, DataBase
from ..psrc import ConnPool
from concurrent.futures import ProcessPoolExecutor,ThreadPoolExecutor,as_completed
app = None
DATABASECONFIG = {
"test":{
"host": "localhost",
"port": 3306,
"usern... | [
2,
66,
7656,
25,
40477,
12,
23,
198,
11748,
4704,
278,
220,
198,
11748,
640,
198,
11748,
12972,
9288,
198,
6738,
764,
8443,
1330,
6060,
11792,
11,
6060,
14881,
198,
6738,
11485,
862,
6015,
1330,
20776,
27201,
198,
6738,
24580,
13,
69,... | 2.348837 | 172 |
from . import parseutil
| [
6738,
764,
1330,
21136,
22602,
198
] | 4 | 6 |
# package org.apache.helix
#from org.apache.helix import *
#from java.lang.reflect import Constructor
#from java.util import ArrayList
#from java.util import Collection
#from java.util import Collections
#from java.util import HashMap
#from java.util import List
#from java.util import Map
from org.apache.helix.util.mi... | [
2,
5301,
8745,
13,
43073,
13,
2978,
844,
198,
2,
6738,
8745,
13,
43073,
13,
2978,
844,
1330,
1635,
198,
2,
6738,
20129,
13,
17204,
13,
35051,
1330,
28407,
273,
198,
2,
6738,
20129,
13,
22602,
1330,
15690,
8053,
198,
2,
6738,
20129,
... | 3.309859 | 142 |
# Copyright (c) 2019 fortiss GmbH
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import unittest
import matplotlib.pyplot as plt
from bark.world.agent import *
from bark.models.behavior import *
from bark.world import *
from bark.geometry import *
from bark.models.dynamic im... | [
2,
15069,
357,
66,
8,
13130,
6285,
747,
402,
2022,
39,
198,
2,
198,
2,
770,
3788,
318,
2716,
739,
262,
17168,
13789,
13,
198,
2,
3740,
1378,
44813,
1668,
13,
2398,
14,
677,
4541,
14,
36393,
198,
198,
11748,
555,
715,
395,
198,
1... | 3.17757 | 214 |
if sm.hasQuest(1666):
sm.warpInstanceIn(931050429)
sm.createClock(6*60)
sm.invokeAfterDelay(6*60*1000, "warpInstanceOut", 230040410, 0)
else:
map = 230040420
portal = 2
sm.warp(map, portal)
| [
361,
895,
13,
10134,
12166,
7,
1433,
2791,
2599,
198,
220,
220,
220,
895,
13,
86,
5117,
33384,
818,
7,
6052,
940,
1120,
11785,
8,
198,
220,
220,
220,
895,
13,
17953,
44758,
7,
21,
9,
1899,
8,
198,
220,
220,
220,
895,
13,
37669,
... | 2.087379 | 103 |
from typing import List, Union
from pysbr.queries.query import Query
import pysbr.utils as utils
class MarketsByMarketIds(Query):
"""Get information about a number of leagues from their league ids.
Market name, description, and market type id are included in the response.
Args:
market_ids: SBR ... | [
6738,
19720,
1330,
7343,
11,
4479,
198,
198,
6738,
279,
893,
1671,
13,
421,
10640,
13,
22766,
1330,
43301,
198,
11748,
279,
893,
1671,
13,
26791,
355,
3384,
4487,
628,
198,
4871,
30251,
3886,
27470,
7390,
82,
7,
20746,
2599,
198,
220,... | 2.985612 | 139 |
from py_uci import UCIEngine
e = UCIEngine()
e.new_game()
e.set_position(moves=["e2e4"])
e.find_best_move()
| [
6738,
12972,
62,
42008,
1330,
14417,
40,
13798,
198,
68,
796,
14417,
40,
13798,
3419,
198,
68,
13,
3605,
62,
6057,
3419,
198,
68,
13,
2617,
62,
9150,
7,
76,
5241,
28,
14692,
68,
17,
68,
19,
8973,
8,
198,
68,
13,
19796,
62,
13466... | 2.204082 | 49 |
name = "branch_bound"
if __name__ == "__main__":
print("branch bound installed!")
| [
3672,
796,
366,
1671,
3702,
62,
7784,
1,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7203,
1671,
3702,
5421,
6589,
2474,
8,
198
] | 2.636364 | 33 |
# coding:utf-8
# tensorflow version1.13.1
import tensorflow as tf
saver = tf.train.import_meta_graph('models/model.ckpt-667589.meta', clear_devices=True)
with tf.Session() as sess:
chpt_state = tf.train.get_checkpoint_state('models/model.ckpt-667589')
# if chpt_state:
# last_model = chpt_state.model_checkpoi... | [
2,
19617,
25,
40477,
12,
23,
198,
2,
11192,
273,
11125,
2196,
16,
13,
1485,
13,
16,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
82,
8770,
796,
48700,
13,
27432,
13,
11748,
62,
28961,
62,
34960,
10786,
27530,
14,
19849,
13,
... | 2.491694 | 301 |
'''Running subprocesses asynchronously.'''
from __future__ import print_function
import fcntl
import os
import os.path
import subprocess
import functools
import datetime
import pty
import signal
import atexit
import tornado.ioloop
from tornado.ioloop import IOLoop, PeriodicCallback
import tornado.process
from seesaw... | [
7061,
6,
28768,
850,
14681,
274,
355,
24871,
3481,
2637,
7061,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
277,
66,
429,
75,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
850,
14681,
198,
11748,
... | 3.22549 | 306 |
from fastai.vision.all import *
import gc
import torch
from typing import Callable
__all__ = ['EMAAverager', 'EMACallback', 'add_ema_to_gan_learner', 'custom_save_model',
'custom_load_model', 'SaveCheckpointsCallback', 'clean_mem']
class EMAAverager():
"""Callable class that calculates the EMA of a p... | [
6738,
3049,
1872,
13,
10178,
13,
439,
1330,
1635,
198,
11748,
308,
66,
198,
11748,
28034,
198,
6738,
19720,
1330,
4889,
540,
628,
198,
834,
439,
834,
796,
37250,
3620,
3838,
332,
3536,
3256,
705,
3620,
2246,
439,
1891,
3256,
705,
2860... | 2.660038 | 2,665 |
"""A set of sudoku puzzles to experiment with the spinnaker_csp package.
the puzzles are containned on the dictionary puzzles, keys are the name of the puzzle and values are tuples with the
puzzle as first element and solution as second element.
"""
puzzles={
#----------------------------------------------------------... | [
37811,
32,
900,
286,
424,
67,
11601,
24367,
284,
6306,
351,
262,
599,
3732,
3110,
62,
66,
2777,
5301,
13,
198,
198,
1169,
24367,
389,
3994,
2817,
319,
262,
22155,
24367,
11,
8251,
389,
262,
1438,
286,
262,
15027,
290,
3815,
389,
127... | 2.015638 | 2,494 |
#!/usr/bin/env python
from __future__ import print_function
import os
print(
"""[busco]
out_path = {0}
tmp_path = {0}/tmp
[tblastn]
# path to tblastn
path = /usr/bin/
[makeblastdb]
# path to makeblastdb
path = /usr/bin/
[augustus]
# path to augustus
path = /opt/augustus/bin/
[etraining]
# path to augustus etraining... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
28686,
198,
4798,
7,
198,
15931,
17912,
10885,
1073,
60,
198,
448,
62,
6978,
796,
1391,
15,
92,
198,
22065,
62,
6978,
796,
... | 2.429553 | 291 |
from flask import Flask, current_app
import jwt
from disasterpets import db
from disasterpets.Pets.models import Pets
| [
6738,
42903,
1330,
46947,
11,
1459,
62,
1324,
198,
11748,
474,
46569,
198,
6738,
9336,
79,
1039,
1330,
20613,
198,
6738,
9336,
79,
1039,
13,
47,
1039,
13,
27530,
1330,
43578,
198
] | 3.6875 | 32 |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
"""
Utilities for downloadi... | [
2,
15069,
357,
66,
8,
2177,
12,
25579,
11,
3203,
11,
3457,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
347,
10305,
12,
7635,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,
262,
6808,
... | 2.638243 | 1,161 |
from datetime import datetime
import pytz
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
12972,
22877,
198,
11748,
2046,
8692,
62,
28482,
198,
6738,
2046,
8692,
62,
28482,
1330,
18031,
198,
6738,
2046,
8692,
62,
28482,
1330,
2046,
8095,
198
] | 4.117647 | 34 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bacpypes.iocb import IOCB
from bacpypes.pdu import Address, GlobalBroadcast
from bacpypes.apdu import WhoIsRequest, ReadPropertyRequest, ReadPropertyACK
from bacpypes.object import get_object_class, get_datatype
from bacpypes.object import ObjectType, registered_object... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
275,
330,
79,
9497,
13,
72,
420,
65,
1330,
48245,
33,
198,
6738,
275,
330,
79,
9497,
13,
79,
646,
1330,
17917... | 1.889121 | 478 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bson.objectid import ObjectId
from pymongo import MongoClient
from validate_email import validate_email
from views.base import base
import config
import hashlib
'''
forms constructor.
* Es necesario crear una variable tipo dict() que debe llevar la siguiente estruc... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
275,
1559,
13,
15252,
312,
1330,
9515,
7390,
198,
6738,
279,
4948,
25162,
1330,
42591,
11792,
198,
6738,
26571,
6... | 2.40566 | 424 |
import traceback
from twisted.internet import reactor
reactor.callWhenRunning(stack)
reactor.run()
| [
11748,
12854,
1891,
198,
6738,
19074,
13,
37675,
1330,
21905,
628,
198,
198,
260,
11218,
13,
13345,
2215,
28768,
7,
25558,
8,
198,
260,
11218,
13,
5143,
3419,
198
] | 3.517241 | 29 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from ralph.util import plugin
from ralph.util.api_scrooge import get_blade_servers
from ralph_scrooge.models import (
AssetIn... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,... | 2.242017 | 1,190 |
from django.db import models
from django.contrib.auth.models import (
AbstractUser,
BaseUserManager
)
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
357,
198,
220,
220,
220,
27741,
12982,
11,
198,
220,
220,
220,
7308,
12982,
13511,
198,
8,
628,
198
] | 2.897436 | 39 |
#!/usr/bin/env python3
#
# Convert Pavlick's dictionary to hunalign
#
import argparse
import re
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
198,
2,
38240,
24081,
75,
624,
338,
22155,
284,
5494,
31494,
198,
2,
198,
198,
11748,
1822,
29572,
198,
11748,
302,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417... | 2.72 | 50 |
# Standard Library
from typing import List, Union, Optional
from ipaddress import IPv4Network, IPv6Network
# Third Party
from pydantic import StrictStr
# Project
from rp.models._common import Flag, RPModel
class RouteFilterEntry(RPModel):
"""JunOS route-filter-list item JSON model."""
address: Union[IPv4Ne... | [
2,
8997,
10074,
198,
6738,
19720,
1330,
7343,
11,
4479,
11,
32233,
198,
6738,
20966,
21975,
1330,
25961,
19,
26245,
11,
25961,
21,
26245,
198,
198,
2,
10467,
3615,
198,
6738,
279,
5173,
5109,
1330,
520,
2012,
13290,
198,
198,
2,
4935,... | 2.908397 | 262 |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
24893,
1087,
318,
10607,
284,
1104,
262,
1280,
2723,
2055,
416,
1642,
5525,
241,
251,
165,
110,
116,
162,
247,
118,
12859,
239,
47,
7252,
50,
33176,
111,
2... | 2.43949 | 942 |
'''
DeviceManager:
a Component that manages different device families e.g. Telescope, Camera, FilterWheel
via a GUI element that permits selection/connection/disconnection
DeviceFamily:
superclass of e.g. Camera, Telescope, FilterWheel
handles communication with devices for generic functions such as
sele... | [
7061,
6,
220,
198,
197,
24728,
13511,
25,
220,
198,
197,
197,
64,
35100,
326,
15314,
1180,
3335,
4172,
304,
13,
70,
13,
36789,
11,
20432,
11,
25853,
45307,
198,
197,
197,
8869,
257,
25757,
5002,
326,
13892,
6356,
14,
38659,
14,
6381... | 3.067327 | 505 |
import numpy as np
import cv2
import time
#Test unit
if __name__ == '__main__':
while True:
img = capture_image(0,10)
print(img)
time.sleep(2)
cv2.imshow("c",img)
cv2.waitKey(0)
cv2.destroyAllWindows()
| [
11748,
299,
32152,
355,
45941,
220,
198,
11748,
269,
85,
17,
198,
11748,
640,
198,
198,
2,
14402,
4326,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
981,
6407,
25,
198,
220,
... | 1.681564 | 179 |
from ._Encode import *
| [
6738,
47540,
4834,
8189,
1330,
1635,
198
] | 3.285714 | 7 |
a = float(2)
b = int(2.0)
c = bool(a)
d = float(None) # fails
e = int(None) # fails
f = bool(None) # fails
# show_store()
| [
64,
796,
12178,
7,
17,
8,
198,
65,
796,
493,
7,
17,
13,
15,
8,
198,
66,
796,
20512,
7,
64,
8,
198,
67,
796,
12178,
7,
14202,
8,
220,
1303,
10143,
198,
68,
796,
493,
7,
14202,
8,
220,
220,
220,
1303,
10143,
198,
69,
796,
20... | 2.047619 | 63 |
from db import nova_conexao
from mysql.connector.errors import ProgrammingError
sql = '''
SELECT A.NOME,
A.TEL,
B.DESCRICAO
FROM CONTATOS A
INNER JOIN GRUPOS B ON A.IDGRUPO = B.ID
ORDER BY B.DESCRICAO, A.NOME
'''
with nova_conexao() as conexao:
try:
c... | [
6738,
20613,
1330,
645,
6862,
62,
49180,
87,
5488,
198,
6738,
48761,
13,
8443,
273,
13,
48277,
1330,
30297,
12331,
198,
198,
25410,
796,
705,
7061,
198,
220,
220,
220,
33493,
220,
317,
13,
45,
13649,
11,
220,
198,
220,
220,
220,
220... | 1.964286 | 308 |
#!/usr/bin/env python3
import json
import logging
import socket
import sys
from os.path import dirname, realpath; sys.path.append(dirname(dirname(dirname(realpath(__file__)))))
from logger.utils.formats import Text
from logger.readers.reader import Reader
# Don't barf if they don't have redis installed. Only compla... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
17802,
198,
11748,
25064,
198,
198,
6738,
28686,
13,
6978,
1330,
26672,
3672,
11,
1103,
6978,
26,
25064,
13,
6978,
13,
33295,
7,
1... | 2.852679 | 896 |
import logging
from synch.enums import ClickHouseEngine
from synch.factory import Global
from synch.replication.etl import etl_full
from synch.writer.collapsing_merge_tree import ClickHouseCollapsingMergeTree
from synch.writer.merge_tree import ClickHouseMergeTree
logger = logging.getLogger("synch.replication.consume... | [
11748,
18931,
198,
198,
6738,
6171,
354,
13,
268,
5700,
1330,
6914,
18102,
13798,
198,
6738,
6171,
354,
13,
69,
9548,
1330,
8060,
198,
6738,
6171,
354,
13,
35666,
3299,
13,
316,
75,
1330,
2123,
75,
62,
12853,
198,
6738,
6171,
354,
1... | 3.282828 | 99 |
# Authors: Lukas Breuer <[email protected]>
"""
----------------------------------------------------------------------
--- jumeg.decompose.fourier_ica_plot ---------------------------------
----------------------------------------------------------------------
autor : Lukas Breuer
email : l.breuer@fz-... | [
2,
46665,
25,
28102,
292,
3719,
15573,
1279,
75,
13,
4679,
15573,
31,
69,
89,
12,
73,
2731,
488,
13,
2934,
29,
198,
198,
37811,
198,
10097,
23031,
198,
6329,
474,
388,
1533,
13,
12501,
3361,
577,
13,
69,
280,
5277,
62,
3970,
62,
... | 2.235067 | 31,825 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : qichun tang
# @Contact : [email protected]
import json
import os
from pathlib import Path
import pandas as pd
from joblib import Parallel, delayed
from joblib import dump
info = {
"bohb": ("HpBandSter-BOHB", "r",),
"ultraopt_BOHB": ("UltraOpt-BOHB"... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
13838,
220,
1058,
10662,
488,
403,
13875,
198,
2,
2488,
17829,
220,
220,
220,
1058,
256,
80,
488,
403,
31,
... | 2.385714 | 350 |
# coding=utf-8
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
33448,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262... | 3.257844 | 1,466 |
import tensorflow as tf
from tensorflow.contrib.framework import add_arg_scope
from tfsnippet.utils import (add_name_and_scope_arg_doc, get_static_shape,
get_default_scope_name)
from .conv2d_ import conv2d
from .utils import validate_conv2d_size_tuple, validate_conv2d_input
__all__ = ['sh... | [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
3642,
822,
13,
30604,
1330,
751,
62,
853,
62,
29982,
198,
198,
6738,
256,
9501,
77,
3974,
316,
13,
26791,
1330,
357,
2860,
62,
3672,
62,
392,
62,
29982,
62,
853... | 2.145611 | 1,971 |
# Copyright The IETF Trust 2007-2019, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
from django.contrib.syndication.views import Feed
from django.utils.feedgenerator import Atom1Feed
from django.conf import settings
from django.utils.h... | [
2,
15069,
383,
314,
22274,
9870,
4343,
12,
23344,
11,
1439,
6923,
33876,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
3601,
62,
8818,
11,
28000,
1098,
... | 3.357143 | 112 |
"""
Zachary Cook
Manages calls to the databases.
"""
import sqlite3
from Controller import ConfigurationManager
from Model import Time,User
"""
Class representing the database.
"""
class DatabaseManager:
"""
Creates a database manager.
"""
"""
Initializes the tables if they aren't defined.
"""
"""
Marks ... | [
37811,
198,
57,
620,
560,
8261,
198,
198,
5124,
1095,
3848,
284,
262,
20083,
13,
198,
37811,
198,
198,
11748,
44161,
578,
18,
198,
6738,
22741,
1330,
28373,
13511,
198,
6738,
9104,
1330,
3862,
11,
12982,
628,
198,
198,
37811,
198,
948... | 3.311594 | 276 |