content stringlengths 1 1.04M | input_ids sequencelengths 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 <greschd@gmx.ch>
"""
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 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 28